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
93c0c043
Unverified
Commit
93c0c043
authored
Feb 17, 2022
by
David Iglesias
Committed by
GitHub
Feb 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[devicelab] Web benchmarks now run on Chromium 89+ (#98629)
parent
e6b30950
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
176 additions
and
2 deletions
+176
-2
browser.dart
dev/devicelab/lib/framework/browser.dart
+19
-2
browser_test.dart
dev/devicelab/test/framework/browser_test.dart
+54
-0
browser_test_json_samples.dart
dev/devicelab/test/framework/browser_test_json_samples.dart
+103
-0
No files found.
dev/devicelab/lib/framework/browser.dart
View file @
93c0c043
...
...
@@ -505,8 +505,17 @@ class BlinkTraceEvent {
/// This event does not include non-UI thread scripting, such as web workers,
/// service workers, and CSS Paint paintlets.
///
/// WebViewImpl::beginFrame was used in earlier versions of Chrome, kept
/// for compatibility.
///
/// This event is a duration event that has its `tdur` populated.
bool
get
isBeginFrame
=>
ph
==
'X'
&&
name
==
'WebViewImpl::beginFrame'
;
bool
get
isBeginFrame
{
return
ph
==
'X'
&&
(
name
==
'WebViewImpl::beginFrame'
||
name
==
'WebFrameWidgetBase::BeginMainFrame'
||
name
==
'WebFrameWidgetImpl::BeginMainFrame'
);
}
/// An "update all lifecycle phases" event contains UI thread computations
/// related to an animation frame that's outside the scripting phase.
...
...
@@ -514,8 +523,16 @@ class BlinkTraceEvent {
/// This event includes style recalculation, layer tree update, layout,
/// painting, and parts of compositing work.
///
/// WebViewImpl::updateAllLifecyclePhases was used in earlier versions of
/// Chrome, kept for compatibility.
///
/// This event is a duration event that has its `tdur` populated.
bool
get
isUpdateAllLifecyclePhases
=>
ph
==
'X'
&&
name
==
'WebViewImpl::updateAllLifecyclePhases'
;
bool
get
isUpdateAllLifecyclePhases
{
return
ph
==
'X'
&&
(
name
==
'WebViewImpl::updateAllLifecyclePhases'
||
name
==
'WebFrameWidgetImpl::UpdateLifecycle'
);
}
/// Whether this is the beginning of a "measured_frame" event.
///
...
...
dev/devicelab/test/framework/browser_test.dart
0 → 100644
View file @
93c0c043
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_devicelab/framework/browser.dart'
;
import
'../common.dart'
;
import
'browser_test_json_samples.dart'
;
void
main
(
)
{
group
(
'BlinkTraceEvent works with Chrome 89+'
,
()
{
// Used to test 'false' results
final
BlinkTraceEvent
unrelatedPhX
=
BlinkTraceEvent
.
fromJson
(
unrelatedPhXJson
);
final
BlinkTraceEvent
anotherUnrelated
=
BlinkTraceEvent
.
fromJson
(
anotherUnrelatedJson
);
test
(
'isBeginFrame'
,
()
{
final
BlinkTraceEvent
event
=
BlinkTraceEvent
.
fromJson
(
beginMainFrameJson_89plus
);
expect
(
event
.
isBeginFrame
,
isTrue
);
expect
(
unrelatedPhX
.
isBeginFrame
,
isFalse
);
expect
(
anotherUnrelated
.
isBeginFrame
,
isFalse
);
});
test
(
'isUpdateAllLifecyclePhases'
,
()
{
final
BlinkTraceEvent
event
=
BlinkTraceEvent
.
fromJson
(
updateLifecycleJson_89plus
);
expect
(
event
.
isUpdateAllLifecyclePhases
,
isTrue
);
expect
(
unrelatedPhX
.
isUpdateAllLifecyclePhases
,
isFalse
);
expect
(
anotherUnrelated
.
isUpdateAllLifecyclePhases
,
isFalse
);
});
test
(
'isBeginMeasuredFrame'
,
()
{
final
BlinkTraceEvent
event
=
BlinkTraceEvent
.
fromJson
(
beginMeasuredFrameJson_89plus
);
expect
(
event
.
isBeginMeasuredFrame
,
isTrue
);
expect
(
unrelatedPhX
.
isBeginMeasuredFrame
,
isFalse
);
expect
(
anotherUnrelated
.
isBeginMeasuredFrame
,
isFalse
);
});
test
(
'isEndMeasuredFrame'
,
()
{
final
BlinkTraceEvent
event
=
BlinkTraceEvent
.
fromJson
(
endMeasuredFrameJson_89plus
);
expect
(
event
.
isEndMeasuredFrame
,
isTrue
);
expect
(
unrelatedPhX
.
isEndMeasuredFrame
,
isFalse
);
expect
(
anotherUnrelated
.
isEndMeasuredFrame
,
isFalse
);
});
});
}
dev/devicelab/test/framework/browser_test_json_samples.dart
0 → 100644
View file @
93c0c043
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:convert'
show
jsonDecode
;
// JSON Event samples taken from running an instrumented version of the
// integration tests of this package that dumped all the data as captured.
/// To test isBeginFrame. (Sampled from Chrome 89+)
final
Map
<
String
,
Object
?>
beginMainFrameJson_89plus
=
jsonDecode
(
'''
{
"args": {
"frameTime": 2338687248768
},
"cat": "blink",
"dur": 6836,
"name": "WebFrameWidgetImpl::BeginMainFrame",
"ph": "X",
"pid": 1367081,
"tdur": 393,
"tid": 1,
"ts": 2338687258440,
"tts": 375499
}
'''
)
as
Map
<
String
,
Object
?>;
/// To test isUpdateAllLifecyclePhases. (Sampled from Chrome 89+)
final
Map
<
String
,
Object
?>
updateLifecycleJson_89plus
=
jsonDecode
(
'''
{
"args": {},
"cat": "blink",
"dur": 103,
"name": "WebFrameWidgetImpl::UpdateLifecycle",
"ph": "X",
"pid": 1367081,
"tdur": 102,
"tid": 1,
"ts": 2338687265284,
"tts": 375900
}
'''
)
as
Map
<
String
,
Object
?>;
/// To test isBeginMeasuredFrame. (Sampled from Chrome 89+)
final
Map
<
String
,
Object
?>
beginMeasuredFrameJson_89plus
=
jsonDecode
(
'''
{
"args": {},
"cat": "blink.user_timing",
"id": "0xea2a8b45",
"name": "measured_frame",
"ph": "b",
"pid": 1367081,
"scope": "blink.user_timing",
"tid": 1,
"ts": 2338687265932
}
'''
)
as
Map
<
String
,
Object
?>;
/// To test isEndMeasuredFrame. (Sampled from Chrome 89+)
final
Map
<
String
,
Object
?>
endMeasuredFrameJson_89plus
=
jsonDecode
(
'''
{
"args": {},
"cat": "blink.user_timing",
"id": "0xea2a8b45",
"name": "measured_frame",
"ph": "e",
"pid": 1367081,
"scope": "blink.user_timing",
"tid": 1,
"ts": 2338687440485
}
'''
)
as
Map
<
String
,
Object
?>;
/// An unrelated data frame to test negative cases.
final
Map
<
String
,
Object
?>
unrelatedPhXJson
=
jsonDecode
(
'''
{
"args": {},
"cat": "blink,rail",
"dur": 2,
"name": "PageAnimator::serviceScriptedAnimations",
"ph": "X",
"pid": 1367081,
"tdur": 2,
"tid": 1,
"ts": 2338691143317,
"tts": 1685405
}
'''
)
as
Map
<
String
,
Object
?>;
/// Another unrelated data frame to test negative cases.
final
Map
<
String
,
Object
?>
anotherUnrelatedJson
=
jsonDecode
(
'''
{
"args": {
"sort_index": -1
},
"cat": "__metadata",
"name": "thread_sort_index",
"ph": "M",
"pid": 1367081,
"tid": 1,
"ts": 2338692906482
}
'''
)
as
Map
<
String
,
Object
?>;
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