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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigate-window.https.html

Issue 2726793002: PlzNavigate: Rewrite the url and frame type validation part of the external/wpt/service-workers/se… (Closed)
Patch Set: Address review comments Created 3 years, 10 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/external/wpt/service-workers/service-worker/navigate-window.https.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigate-window.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigate-window.https.html
index 31e800f2904bd45904cbf5305bb782b4a813f9ee..3c8533a80004702fef2db781eec5637b3ffba898 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigate-window.https.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigate-window.https.html
@@ -58,6 +58,10 @@ function get_clients(win, sw, opts) {
});
}
+function compare_urls(a, b) {
+ return a.url < b.url ? -1 : b.url < a.url ? 1 : 0;
+}
+
function validate_window(win, url, opts) {
return win.navigator.serviceWorker.getRegistration(url)
.then(reg => {
@@ -78,16 +82,22 @@ function validate_window(win, url, opts) {
if (opts.includeUncontrolled) {
expected.push({ url: BASE_URL + 'navigate-window.https.html',
frameType: 'auxiliary' });
- expected.push({ url: host_info['HTTPS_ORIGIN'] + '/testharness_runner.html',
- frameType: 'top-level' });
+ expected.push({
+ url: host_info['HTTPS_ORIGIN'] + '/testharness_runner.html',
+ frameType: 'top-level' });
}
+
assert_equals(resultList.length, expected.length,
'expected number of clients');
+
+ expected.sort(compare_urls);
+ resultList.sort(compare_urls);
+
for (var i = 0; i < resultList.length; ++i) {
- assert_equals(resultList[i].url, expected[i].url,
+ assert_equals(expected[i].url, resultList[i].url,
'client should have expected url');
- assert_equals(resultList[i].frameType, expected[i].frameType,
- ' client should have expected frame type');
+ assert_equals(expected[i].frameType, resultList[i].frameType,
+ 'client should have expected frame type');
}
return win;
})

Powered by Google App Engine
This is Rietveld 408576698