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

Side by Side Diff: chrome/test/data/extensions/platform_apps/restrictions/test.js

Issue 10534054: Improve extension api tests: run all tests, even if one fails (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix some tests Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/extensions/api_test/tabs/get_current/test.js ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 assertEq = chrome.test.assertEq; 5 var assertEq = chrome.test.assertEq;
6 var fail = chrome.test.fail; 6 var fail = chrome.test.fail;
7 var succeed = chrome.test.succeed; 7 var succeed = chrome.test.succeed;
8 8
9 var DEFAULT_EXPECTED_ERROR = "Not available for platform apps."; 9 var DEFAULT_EXPECTED_ERROR = "Not available for platform apps.";
10 10
11 function assertThrowsError(method, opt_expectedError) { 11 function assertThrowsError(method, opt_expectedError) {
12 try { 12 try {
13 method(); 13 method();
14 fail("error not thrown"); 14 fail("error not thrown");
15 } catch (e) { 15 } catch (e) {
16 assertEq(e.message || e, opt_expectedError || DEFAULT_EXPECTED_ERROR); 16 assertEq(opt_expectedError || DEFAULT_EXPECTED_ERROR, e.message || e);
17 } 17 }
18 } 18 }
19 19
20 chrome.test.runTests([ 20 chrome.test.runTests([
21 function testDocumentOpen() { 21 function testDocumentOpen() {
22 assertThrowsError(document.open); 22 assertThrowsError(document.open);
23 succeed(); 23 succeed();
24 }, 24 },
25 25
26 function testDocumentClose() { 26 function testDocumentClose() {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 }, 134 },
135 135
136 function testSyncXhr() { 136 function testSyncXhr() {
137 var xhr = new XMLHttpRequest(); 137 var xhr = new XMLHttpRequest();
138 assertThrowsError(function() { 138 assertThrowsError(function() {
139 xhr.open('GET', 'data:should not load', false); 139 xhr.open('GET', 'data:should not load', false);
140 }, 'INVALID_ACCESS_ERR: DOM Exception 15'); 140 }, 'INVALID_ACCESS_ERR: DOM Exception 15');
141 succeed(); 141 succeed();
142 } 142 }
143 ]); 143 ]);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/tabs/get_current/test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698