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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/bindings/templates/callback_interface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 importScripts('worker-test-helpers.js'); 1 importScripts('worker-test-helpers.js');
2 2
3 test(function() { 3 test(function() {
4 var expectedMap = { 4 var expectedMap = {
5 'Content-Language': 'ja', 5 'Content-Language': 'ja',
6 'Content-Type': 'text/html; charset=UTF-8', 6 'Content-Type': 'text/html; charset=UTF-8',
7 'X-ServiceWorker-Test': 'response test field' 7 'X-ServiceWorker-Test': 'response test field'
8 }; 8 };
9 9
10 var headers = new HeaderMap; 10 var headers = new HeaderMap;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 expectedMap[key] = expectedValue; 75 expectedMap[key] = expectedValue;
76 }); 76 });
77 77
78 // 'forEach()' 78 // 'forEach()'
79 headers.forEach(function(value, key) { 79 headers.forEach(function(value, key) {
80 assert_true(key != deleteKey); 80 assert_true(key != deleteKey);
81 assert_true(key in expectedMap); 81 assert_true(key in expectedMap);
82 assert_equals(headers.get(key), expectedMap[key]); 82 assert_equals(headers.get(key), expectedMap[key]);
83 }); 83 });
84 84
85 // 'forEach()' with thisArg
86 var that = {}, saw_that;
87 headers = new HeaderMap;
88 headers.set('a', 'b');
89 headers.forEach(function() { saw_that = this; }, that);
90 assert_equals(saw_that, that, 'Passed thisArg should match');
91
92 headers.forEach(function() { 'use strict'; saw_that = this; }, 'abc');
93 assert_equals(saw_that, 'abc', 'Passed non-object thisArg should match');
94
95 headers.forEach(function() { saw_that = this; }, null);
96 assert_equals(saw_that, self, 'Passed null thisArg should be replaced with g lobal object');
97
85 }, 'HeaderMap in ServiceWorkerGlobalScope'); 98 }, 'HeaderMap in ServiceWorkerGlobalScope');
86
OLDNEW
« 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