Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
189028a9
Commit
189028a9
authored
Apr 04, 2017
by
Alexandre Ardhuin
Committed by
GitHub
Apr 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate the 'if' expression from its statement (#9177)
parent
0cf2f88f
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
41 additions
and
21 deletions
+41
-21
run.dart
dev/devicelab/bin/run.dart
+2
-1
adb.dart
dev/devicelab/lib/framework/adb.dart
+2
-1
runner.dart
dev/devicelab/lib/framework/runner.dart
+2
-1
utils.dart
dev/devicelab/lib/framework/utils.dart
+3
-2
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+2
-1
update_test.dart
examples/flutter_gallery/test/update_test.dart
+2
-1
driver.dart
packages/flutter_driver/lib/src/driver.dart
+2
-1
android_studio.dart
packages/flutter_tools/lib/src/android/android_studio.dart
+2
-1
asset.dart
packages/flutter_tools/lib/src/asset.dart
+4
-2
os.dart
packages/flutter_tools/lib/src/base/os.dart
+2
-1
version.dart
packages/flutter_tools/lib/src/base/version.dart
+8
-4
channel.dart
packages/flutter_tools/lib/src/commands/channel.dart
+6
-3
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+2
-1
create_test.dart
packages/flutter_tools/test/create_test.dart
+2
-1
No files found.
dev/devicelab/bin/run.dart
View file @
189028a9
...
...
@@ -128,7 +128,8 @@ final ArgParser _argParser = new ArgParser()
);
bool
_listsEqual
(
List
<
dynamic
>
a
,
List
<
dynamic
>
b
)
{
if
(
a
.
length
!=
b
.
length
)
return
false
;
if
(
a
.
length
!=
b
.
length
)
return
false
;
for
(
int
i
=
0
;
i
<
a
.
length
;
i
++)
{
if
(
a
[
i
]
!=
b
[
i
])
...
...
dev/devicelab/lib/framework/adb.dart
View file @
189028a9
...
...
@@ -384,7 +384,8 @@ String get adbPath {
final
String
adbPath
=
path
.
join
(
androidHome
,
'platform-tools/adb'
);
if
(!
canRun
(
adbPath
))
throw
'adb not found at:
$adbPath
'
;
if
(!
canRun
(
adbPath
))
throw
'adb not found at:
$adbPath
'
;
return
path
.
absolute
(
adbPath
);
}
dev/devicelab/lib/framework/runner.dart
View file @
189028a9
...
...
@@ -101,7 +101,8 @@ Future<VMIsolateRef> _connectToRunnerIsolate(int vmServicePort) async {
final
VM
vm
=
await
client
.
getVM
();
final
VMIsolateRef
isolate
=
vm
.
isolates
.
single
;
final
String
response
=
await
isolate
.
invokeExtension
(
'ext.cocoonRunnerReady'
);
if
(
response
!=
'ready'
)
throw
'not ready yet'
;
if
(
response
!=
'ready'
)
throw
'not ready yet'
;
return
isolate
;
}
catch
(
error
)
{
const
Duration
connectionTimeout
=
const
Duration
(
seconds:
2
);
...
...
dev/devicelab/lib/framework/utils.dart
View file @
189028a9
...
...
@@ -306,7 +306,8 @@ Directory get flutterDirectory => dir('../..').absolute;
String
requireEnvVar
(
String
name
)
{
final
String
value
=
Platform
.
environment
[
name
];
if
(
value
==
null
)
fail
(
'
$name
environment variable is missing. Quitting.'
);
if
(
value
==
null
)
fail
(
'
$name
environment variable is missing. Quitting.'
);
return
value
;
}
...
...
@@ -450,4 +451,4 @@ Future<int> findAvailablePort() async {
}
}
bool
canRun
(
String
path
)
=>
_processManager
.
canRun
(
path
);
\ No newline at end of file
bool
canRun
(
String
path
)
=>
_processManager
.
canRun
(
path
);
dev/devicelab/lib/tasks/perf_tests.dart
View file @
189028a9
...
...
@@ -112,7 +112,8 @@ class StartupTest {
]).
timeout
(
_startupTimeout
);
final
Map
<
String
,
dynamic
>
data
=
JSON
.
decode
(
file
(
'
$testDirectory
/build/start_up_info.json'
).
readAsStringSync
());
if
(!
reportMetrics
)
return
new
TaskResult
.
success
(
data
);
if
(!
reportMetrics
)
return
new
TaskResult
.
success
(
data
);
return
new
TaskResult
.
success
(
data
,
benchmarkScoreKeys:
<
String
>[
'timeToFirstFrameMicros'
,
...
...
examples/flutter_gallery/test/update_test.dart
View file @
189028a9
...
...
@@ -12,7 +12,8 @@ Future<String> mockUpdateUrlFetcher() {
void
main
(
)
{
final
TestWidgetsFlutterBinding
binding
=
TestWidgetsFlutterBinding
.
ensureInitialized
();
if
(
binding
is
LiveTestWidgetsFlutterBinding
)
binding
.
allowAllFrames
=
true
;
if
(
binding
is
LiveTestWidgetsFlutterBinding
)
binding
.
allowAllFrames
=
true
;
// Regression test for https://github.com/flutter/flutter/pull/5168
testWidgets
(
'update dialog'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter_driver/lib/src/driver.dart
View file @
189028a9
...
...
@@ -537,7 +537,8 @@ Future<VMServiceClientConnection> _waitAndConnect(String url) async {
Future
<
VMServiceClientConnection
>
attemptConnection
()
async
{
Uri
uri
=
Uri
.
parse
(
url
);
if
(
uri
.
scheme
==
'http'
)
uri
=
uri
.
replace
(
scheme:
'ws'
,
path:
'/ws'
);
if
(
uri
.
scheme
==
'http'
)
uri
=
uri
.
replace
(
scheme:
'ws'
,
path:
'/ws'
);
WebSocket
ws1
;
WebSocket
ws2
;
...
...
packages/flutter_tools/lib/src/android/android_studio.dart
View file @
189028a9
...
...
@@ -190,7 +190,8 @@ class AndroidStudio implements Comparable<AndroidStudio> {
bool
_hasStudioAt
(
String
path
,
{
Version
newerThan
})
{
return
studios
.
any
((
AndroidStudio
studio
)
{
if
(
studio
.
directory
!=
path
)
return
false
;
if
(
studio
.
directory
!=
path
)
return
false
;
if
(
newerThan
!=
null
)
{
return
studio
.
version
.
compareTo
(
newerThan
)
>=
0
;
}
...
...
packages/flutter_tools/lib/src/asset.dart
View file @
189028a9
...
...
@@ -374,11 +374,13 @@ Map<_Asset, List<_Asset>> _parseAssets(
if
(
manifestDescriptor
.
containsKey
(
'fonts'
))
{
for
(
Map
<
String
,
dynamic
>
family
in
manifestDescriptor
[
'fonts'
])
{
final
List
<
Map
<
String
,
dynamic
>>
fonts
=
family
[
'fonts'
];
if
(
fonts
==
null
)
continue
;
if
(
fonts
==
null
)
continue
;
for
(
Map
<
String
,
dynamic
>
font
in
fonts
)
{
final
String
asset
=
font
[
'asset'
];
if
(
asset
==
null
)
continue
;
if
(
asset
==
null
)
continue
;
final
_Asset
baseAsset
=
_resolveAsset
(
packageMap
,
assetBase
,
asset
);
if
(!
baseAsset
.
assetFileExists
)
{
...
...
packages/flutter_tools/lib/src/base/os.dart
View file @
189028a9
...
...
@@ -207,7 +207,8 @@ String findProjectRoot([String directory]) {
if
(
fs
.
isFileSync
(
fs
.
path
.
join
(
directory
,
kProjectRootSentinel
)))
return
directory
;
final
String
parent
=
fs
.
path
.
dirname
(
directory
);
if
(
directory
==
parent
)
return
null
;
if
(
directory
==
parent
)
return
null
;
directory
=
parent
;
}
}
packages/flutter_tools/lib/src/base/version.dart
View file @
189028a9
...
...
@@ -25,8 +25,10 @@ class Version implements Comparable<Version> {
factory
Version
(
int
major
,
int
minor
,
int
patch
,
{
String
text
})
{
if
(
text
==
null
)
{
text
=
major
==
null
?
'0'
:
'
$major
'
;
if
(
minor
!=
null
)
text
=
'
$text
.
$minor
'
;
if
(
patch
!=
null
)
text
=
'
$text
.
$patch
'
;
if
(
minor
!=
null
)
text
=
'
$text
.
$minor
'
;
if
(
patch
!=
null
)
text
=
'
$text
.
$patch
'
;
}
return
new
Version
.
_
(
major
??
0
,
minor
??
0
,
patch
??
0
,
text
);
...
...
@@ -93,8 +95,10 @@ class Version implements Comparable<Version> {
@override
int
compareTo
(
Version
other
)
{
if
(
major
!=
other
.
major
)
return
major
.
compareTo
(
other
.
major
);
if
(
minor
!=
other
.
minor
)
return
minor
.
compareTo
(
other
.
minor
);
if
(
major
!=
other
.
major
)
return
major
.
compareTo
(
other
.
major
);
if
(
minor
!=
other
.
minor
)
return
minor
.
compareTo
(
other
.
minor
);
return
patch
.
compareTo
(
other
.
patch
);
}
...
...
packages/flutter_tools/lib/src/commands/channel.dart
View file @
189028a9
...
...
@@ -43,10 +43,13 @@ class ChannelCommand extends FlutterCommand {
workingDirectory:
Cache
.
flutterRoot
,
mapFunction:
(
String
line
)
{
final
List
<
String
>
split
=
line
.
split
(
'/'
);
if
(
split
.
length
<
2
)
return
null
;
if
(
split
.
length
<
2
)
return
null
;
final
String
branchName
=
split
[
1
];
if
(
branchName
.
startsWith
(
'HEAD'
))
return
null
;
if
(
branchName
==
currentBranch
)
return
'*
$branchName
'
;
if
(
branchName
.
startsWith
(
'HEAD'
))
return
null
;
if
(
branchName
==
currentBranch
)
return
'*
$branchName
'
;
return
'
$branchName
'
;
},
);
...
...
packages/flutter_tools/lib/src/doctor.dart
View file @
189028a9
...
...
@@ -369,7 +369,8 @@ class IntelliJValidatorOnLinuxAndWindows extends IntelliJValidator {
static
Iterable
<
DoctorValidator
>
get
installed
{
final
List
<
DoctorValidator
>
validators
=
<
DoctorValidator
>[];
if
(
homeDirPath
==
null
)
return
validators
;
if
(
homeDirPath
==
null
)
return
validators
;
void
addValidator
(
String
title
,
String
version
,
String
installPath
,
String
pluginsPath
)
{
final
IntelliJValidatorOnLinuxAndWindows
validator
=
...
...
packages/flutter_tools/test/create_test.dart
View file @
189028a9
...
...
@@ -115,7 +115,8 @@ void main() {
final
CreateCommand
command
=
new
CreateCommand
();
final
CommandRunner
<
Null
>
runner
=
createTestCommandRunner
(
command
);
final
File
existingFile
=
fs
.
file
(
"
${temp.path.toString()}
/bad"
);
if
(!
existingFile
.
existsSync
())
existingFile
.
createSync
();
if
(!
existingFile
.
existsSync
())
existingFile
.
createSync
();
try
{
await
runner
.
run
(<
String
>[
'create'
,
existingFile
.
path
]);
fail
(
'expected ToolExit exception'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment