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

Side by Side Diff: chrome/test/data/extensions/api_test/executescript/frame_id/test.js

Issue 2886633002: [Extension Bindings] Update ExecuteScriptApiTest.ExecuteScriptByFrameId (Closed)
Patch Set: Created 3 years, 7 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var pass = chrome.test.callbackPass; 5 var pass = chrome.test.callbackPass;
6 var fail = chrome.test.callbackFail; 6 var fail = chrome.test.callbackFail;
7 var assertEq = chrome.test.assertEq; 7 var assertEq = chrome.test.assertEq;
8 var assertTrue = chrome.test.assertTrue; 8 var assertTrue = chrome.test.assertTrue;
9 var relativePath = '/extensions/api_test/executescript/frame_id/frames.html'; 9 var relativePath = '/extensions/api_test/executescript/frame_id/frames.html';
10 var testOrigin = 'http://a.com:PORT'; 10 var testOrigin = 'http://a.com:PORT';
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 }, 237 },
238 238
239 function executeScriptWithNegativeFrameId() { 239 function executeScriptWithNegativeFrameId() {
240 try { 240 try {
241 chrome.tabs.executeScript( 241 chrome.tabs.executeScript(
242 tabId, {frameId: -1, code: 'document.URL'}, function() { 242 tabId, {frameId: -1, code: 'document.URL'}, function() {
243 chrome.test.fail( 243 chrome.test.fail(
244 'executeScript should never have been executed!'); 244 'executeScript should never have been executed!');
245 }); 245 });
246 } catch (e) { 246 } catch (e) {
247 assertEq( 247 assertTrue(
248 'Invalid value for argument 2. Property \'frameId\': ' + 248 e.message == 'Invalid value for argument 2. Property \'frameId\':' +
lazyboy 2017/05/20 01:51:54 Here and below: add a comment saying which binding
Devlin 2017/05/23 22:29:56 Done.
249 'Value must not be less than 0.', 249 ' Value must not be less than 0.' ||
250 e.message == 'Error in invocation of tabs.executeScript(' +
251 'optional integer tabId, ' +
252 'extensionTypes.InjectDetails details, ' +
253 'optional function callback): Error at parameter ' +
254 '\'details\': Error at property \'frameId\': ' +
255 'Value must be at least 0.',
250 e.message); 256 e.message);
251 chrome.test.succeed(); 257 chrome.test.succeed();
252 } 258 }
253 }, 259 },
254 260
255 function insertCSSInTopFrame() { 261 function insertCSSInTopFrame() {
256 insertCSS(tabId, {frameId: 0}, pass(function(results) { 262 insertCSS(tabId, {frameId: 0}, pass(function(results) {
257 assertEq(1, results.length); 263 assertEq(1, results.length);
258 assertTrue(matchesAny(results, R_FRAME_TOP)); 264 assertTrue(matchesAny(results, R_FRAME_TOP));
259 })); 265 }));
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 fail('No frame with id 999999999 in tab ' + tabId + '.')); 366 fail('No frame with id 999999999 in tab ' + tabId + '.'));
361 }, 367 },
362 368
363 function insertCSSWithNegativeFrameId() { 369 function insertCSSWithNegativeFrameId() {
364 try { 370 try {
365 chrome.tabs.insertCSS( 371 chrome.tabs.insertCSS(
366 tabId, {frameId: -1, code: 'body{color:red}'}, function() { 372 tabId, {frameId: -1, code: 'body{color:red}'}, function() {
367 chrome.test.fail('insertCSS should never have been executed!'); 373 chrome.test.fail('insertCSS should never have been executed!');
368 }); 374 });
369 } catch (e) { 375 } catch (e) {
370 assertEq( 376 assertTrue(
371 'Invalid value for argument 2. Property \'frameId\': ' + 377 e.message == 'Invalid value for argument 2. Property \'frameId\':' +
372 'Value must not be less than 0.', 378 ' Value must not be less than 0.' ||
379 e.message == 'Error in invocation of tabs.insertCSS(' +
380 'optional integer tabId, ' +
381 'extensionTypes.InjectDetails details, ' +
382 'optional function callback): Error at parameter ' +
383 '\'details\': Error at property \'frameId\': ' +
384 'Value must be at least 0.',
373 e.message); 385 e.message);
374 chrome.test.succeed(); 386 chrome.test.succeed();
375 } 387 }
376 }, 388 },
377 389
378 ]); 390 ]);
379 } 391 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698