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

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: More indent fixes 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..a8140768c04ade8ce95c784e82da54986f985a00 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
@@ -81,13 +81,26 @@ function validate_window(win, url, opts) {
expected.push({ url: host_info['HTTPS_ORIGIN'] + '/testharness_runner.html',
frameType: 'top-level' });
}
+
assert_equals(resultList.length, expected.length,
'expected number of clients');
- for (var i = 0; i < resultList.length; ++i) {
- assert_equals(resultList[i].url, expected[i].url,
- 'client should have expected url');
- assert_equals(resultList[i].frameType, expected[i].frameType,
- ' client should have expected frame type');
+
+ // Check if the URLs and the frame type in the result list match with those in
jsbell 2017/03/02 20:19:49 Would it be easier to just to sort the lists by ur
jsbell 2017/03/02 20:19:49 nit: wrap to 80 columns? (since this file is _mos
ananta 2017/03/02 23:21:10 Thanks. Done. I added a compare_urls comparator fu
ananta 2017/03/02 23:21:10 Removed this comment
+ // the expected list.
+ for (var i = 0; i < expected.length; ++i) {
+ var foundMatch = false;
+ var matchingFrameType;
+ for (var j = 0; j < resultList.length; ++j) {
+ if (expected[i].url == resultList[j].url) {
jsbell 2017/03/02 20:19:49 nit: this file seems to prefer === to ==
ananta 2017/03/02 23:21:10 Not needed after sorting.
+ foundMatch = true;
+ matchingFrameType = resultList[j].frameType;
+ break;
+ }
+ }
+ assert_equals(foundMatch, true,
+ 'client should have expected url ' + expected[i].url);
+ assert_equals(expected[i].frameType, matchingFrameType,
+ 'client should have expected frame type');
}
return win;
})

Powered by Google App Engine
This is Rietveld 408576698