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'); |