Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause.html

Issue 2207973003: [DevTools] Removed InspectorTest.invokePageFunctionPromise from protocol tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause.html b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause.html
index 2921181ac11b5b438f6e2b0cc1506abceee5f0d8..a92eafd67b28427930d7d136ab05a61ea5f35573 100644
--- a/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause.html
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause.html
@@ -15,18 +15,15 @@ function getWidth()
return node.offsetWidth;
}
-function rafWidth(resolve, reject)
+function rafWidth()
{
- function frameCallback()
- {
- resolve(node.offsetWidth);
- }
-
+ var callback;
+ var promise = new Promise((fulfill) => callback = fulfill);
if (window.testRunner)
- testRunner.layoutAndPaintAsyncThen(frameCallback);
+ testRunner.layoutAndPaintAsyncThen(() => callback(node.offsetWidth));
+ return promise;
}
-window.debugTest = true;
function test()
{
InspectorTest.eventHandler["Animation.animationStarted"] = onStarted;
@@ -46,11 +43,11 @@ function test()
function saveWidth(nodeWidth)
{
- var width = nodeWidth;
- InspectorTest.invokePageFunctionPromise("rafWidth", []).then(function(result) {
- InspectorTest.log(result === width);
- InspectorTest.completeTest();
- });
+ InspectorTest.evaluateInPageAsync("rafWidth()")
+ .then(function(result) {
+ InspectorTest.log(result === nodeWidth);
+ InspectorTest.completeTest();
+ });
}
}

Powered by Google App Engine
This is Rietveld 408576698