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
21588019
Unverified
Commit
21588019
authored
Apr 15, 2020
by
Pierre-Louis
Committed by
GitHub
Apr 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_driver] Fix browser check (#54741)
parent
b6262e7c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
28 deletions
+18
-28
driver.dart
packages/flutter_driver/lib/src/driver/driver.dart
+9
-9
web_driver.dart
packages/flutter_driver/lib/src/driver/web_driver.dart
+3
-13
flutter_driver_test.dart
packages/flutter_driver/test/flutter_driver_test.dart
+6
-6
No files found.
packages/flutter_driver/lib/src/driver/driver.dart
View file @
21588019
...
...
@@ -167,7 +167,7 @@ abstract class FlutterDriver {
///
/// * [VMServiceFlutterDriver], which uses vmservice to implement.
/// * [WebFlutterDriver], which uses webdriver to implement.
Future
<
Map
<
String
,
dynamic
>>
sendCommand
(
Command
command
)
=>
throw
UnimplementedError
();
Future
<
Map
<
String
,
dynamic
>>
sendCommand
(
Command
command
)
async
=>
throw
UnimplementedError
();
/// Checks the status of the Flutter Driver extension.
Future
<
Health
>
checkHealth
({
Duration
timeout
})
async
{
...
...
@@ -560,7 +560,7 @@ abstract class FlutterDriver {
/// In practice, sometimes the device gets really busy for a while and
/// even two seconds isn't enough, which means that this is still racy
/// and a source of flakes.
Future
<
List
<
int
>>
screenshot
()
{
Future
<
List
<
int
>>
screenshot
()
async
{
throw
UnimplementedError
();
}
...
...
@@ -585,7 +585,7 @@ abstract class FlutterDriver {
/// [getFlagList]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#getflaglist
///
/// Throws [UnimplementedError] on [WebFlutterDriver] instances.
Future
<
List
<
Map
<
String
,
dynamic
>>>
getVmFlags
()
{
Future
<
List
<
Map
<
String
,
dynamic
>>>
getVmFlags
()
async
{
throw
UnimplementedError
();
}
/// Starts recording performance traces.
...
...
@@ -598,7 +598,7 @@ abstract class FlutterDriver {
Future
<
void
>
startTracing
({
List
<
TimelineStream
>
streams
=
const
<
TimelineStream
>[
TimelineStream
.
all
],
Duration
timeout
=
kUnusuallyLongTimeout
,
})
{
})
async
{
throw
UnimplementedError
();
}
...
...
@@ -611,7 +611,7 @@ abstract class FlutterDriver {
/// For [WebFlutterDriver], this is only supported for Chrome.
Future
<
Timeline
>
stopTracingAndDownloadTimeline
({
Duration
timeout
=
kUnusuallyLongTimeout
,
})
{
})
async
{
throw
UnimplementedError
();
}
/// Runs [action] and outputs a performance trace for it.
...
...
@@ -637,7 +637,7 @@ abstract class FlutterDriver {
Future
<
dynamic
>
action
(),
{
List
<
TimelineStream
>
streams
=
const
<
TimelineStream
>[
TimelineStream
.
all
],
bool
retainPriorEvents
=
false
,
})
{
})
async
{
throw
UnimplementedError
();
}
...
...
@@ -650,7 +650,7 @@ abstract class FlutterDriver {
/// For [WebFlutterDriver], this is only supported for Chrome.
Future
<
void
>
clearTimeline
({
Duration
timeout
=
kUnusuallyLongTimeout
,
})
{
})
async
{
throw
UnimplementedError
();
}
/// [action] will be executed with the frame sync mechanism disabled.
...
...
@@ -683,14 +683,14 @@ abstract class FlutterDriver {
/// Force a garbage collection run in the VM.
///
/// Throws [UnimplementedError] on [WebFlutterDriver] instances.
Future
<
void
>
forceGC
()
{
Future
<
void
>
forceGC
()
async
{
throw
UnimplementedError
();
}
/// Closes the underlying connection to the VM service.
///
/// Returns a [Future] that fires once the connection has been closed.
Future
<
void
>
close
()
{
Future
<
void
>
close
()
async
{
throw
UnimplementedError
();
}
}
...
...
packages/flutter_driver/lib/src/driver/web_driver.dart
View file @
21588019
...
...
@@ -154,7 +154,7 @@ class WebFlutterDriver extends FlutterDriver {
/// Checks whether browser supports Timeline related operations
void
_checkBrowserSupportsTimeline
()
{
if
(
_connection
.
supportsTimelineAction
)
{
if
(
!
_connection
.
supportsTimelineAction
)
{
throw
UnsupportedError
(
'Timeline action is not supported by current testing browser'
);
}
}
...
...
@@ -164,22 +164,12 @@ class WebFlutterDriver extends FlutterDriver {
class
FlutterWebConnection
{
/// Creates a FlutterWebConnection with WebDriver
/// and whether the WebDriver supports timeline action
FlutterWebConnection
(
this
.
_driver
,
this
.
_
supportsTimelineAction
);
FlutterWebConnection
(
this
.
_driver
,
this
.
supportsTimelineAction
);
final
async_io
.
WebDriver
_driver
;
bool
_supportsTimelineAction
;
/// Whether the connected WebDriver supports timeline action for Flutter Web Driver
// ignore: unnecessary_getters_setters
bool
get
supportsTimelineAction
=>
_supportsTimelineAction
;
/// Setter for _supportsTimelineAction
@visibleForTesting
// ignore: unnecessary_getters_setters
set
supportsTimelineAction
(
bool
value
)
{
_supportsTimelineAction
=
value
;
}
bool
supportsTimelineAction
;
/// Starts WebDriver with the given [settings] and
/// establishes the connection to Flutter Web application.
...
...
packages/flutter_driver/test/flutter_driver_test.dart
View file @
21588019
...
...
@@ -693,7 +693,7 @@ void main() {
setUp
(()
{
mockConnection
=
MockFlutterWebConnection
();
mockConnection
.
supportsTimelineAction
=
true
;
when
(
mockConnection
.
supportsTimelineAction
).
thenReturn
(
true
)
;
driver
=
WebFlutterDriver
.
connectedTo
(
mockConnection
);
});
...
...
@@ -1033,19 +1033,19 @@ void main() {
setUp
(()
{
mockConnection
=
MockFlutterWebConnection
();
mockConnection
.
supportsTimelineAction
=
false
;
when
(
mockConnection
.
supportsTimelineAction
).
thenReturn
(
false
)
;
driver
=
WebFlutterDriver
.
connectedTo
(
mockConnection
);
});
test
(
'tracing'
,
()
async
{
expect
(
driver
.
traceAction
(()
async
{
return
Future
<
dynamic
>.
value
();
}),
throwsA
(
isA
<
Un
implemen
tedError
>()));
throwsA
(
isA
<
Un
suppor
tedError
>()));
expect
(
driver
.
startTracing
(),
throwsA
(
isA
<
Un
implemen
tedError
>()));
throwsA
(
isA
<
Un
suppor
tedError
>()));
expect
(
driver
.
stopTracingAndDownloadTimeline
(),
throwsA
(
isA
<
Un
implemen
tedError
>()));
throwsA
(
isA
<
Un
suppor
tedError
>()));
expect
(
driver
.
clearTimeline
(),
throwsA
(
isA
<
Un
implemen
tedError
>()));
throwsA
(
isA
<
Un
suppor
tedError
>()));
});
});
}
...
...
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