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

Unified Diff: LayoutTests/http/tests/serviceworker/resources/headermap-worker.js

Issue 330163004: Fix V8 callback binding for "CallWith=ThisValue" attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add extra layout test cases from https://codereview.chromium.org/330973002. Created 6 years, 6 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
« no previous file with comments | « no previous file | Source/bindings/templates/callback_interface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/serviceworker/resources/headermap-worker.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/headermap-worker.js b/LayoutTests/http/tests/serviceworker/resources/headermap-worker.js
index 0cba6fbdd69fcd83aea3fe2acc0493da1b0dfb73..c6c746cc410cf7f9f0b176219fc61487e4bd9e11 100644
--- a/LayoutTests/http/tests/serviceworker/resources/headermap-worker.js
+++ b/LayoutTests/http/tests/serviceworker/resources/headermap-worker.js
@@ -82,5 +82,17 @@ test(function() {
assert_equals(headers.get(key), expectedMap[key]);
});
-}, 'HeaderMap in ServiceWorkerGlobalScope');
+ // 'forEach()' with thisArg
+ var that = {}, saw_that;
+ headers = new HeaderMap;
+ headers.set('a', 'b');
+ headers.forEach(function() { saw_that = this; }, that);
+ assert_equals(saw_that, that, 'Passed thisArg should match');
+
+ headers.forEach(function() { 'use strict'; saw_that = this; }, 'abc');
+ assert_equals(saw_that, 'abc', 'Passed non-object thisArg should match');
+ headers.forEach(function() { saw_that = this; }, null);
+ assert_equals(saw_that, self, 'Passed null thisArg should be replaced with global object');
+
+}, 'HeaderMap in ServiceWorkerGlobalScope');
« no previous file with comments | « no previous file | Source/bindings/templates/callback_interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698