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

Side by Side Diff: chrome/renderer/resources/extension_apitest.js

Issue 3672003: fix bookmarks API crash when handling invalid URL (Closed)
Patch Set: missing semicolon Created 10 years, 2 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // extension_apitest.js 5 // extension_apitest.js
6 // mini-framework for ExtensionApiTest browser tests 6 // mini-framework for ExtensionApiTest browser tests
7 7
8 var chrome = chrome || {}; 8 var chrome = chrome || {};
9 (function() { 9 (function() {
10 chrome.test = chrome.test || {}; 10 chrome.test = chrome.test || {};
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 if (func) { 166 if (func) {
167 chrome.test.assertEq(typeof(func), 'function'); 167 chrome.test.assertEq(typeof(func), 'function');
168 } 168 }
169 var callbackCompleted = chrome.test.callbackAdded(); 169 var callbackCompleted = chrome.test.callbackAdded();
170 170
171 return function() { 171 return function() {
172 if (expectedError == null) { 172 if (expectedError == null) {
173 chrome.test.assertNoLastError(); 173 chrome.test.assertNoLastError();
174 } else { 174 } else {
175 chrome.test.assertEq(typeof(expectedError), 'string'); 175 chrome.test.assertEq(typeof(expectedError), 'string');
176 chrome.test.assertTrue(chrome.extension.lastError != undefined,
177 "No lastError, but expected " + expectedError);
176 chrome.test.assertEq(expectedError, chrome.extension.lastError.message); 178 chrome.test.assertEq(expectedError, chrome.extension.lastError.message);
177 } 179 }
178 180
179 if (func) { 181 if (func) {
180 safeFunctionApply(func, arguments); 182 safeFunctionApply(func, arguments);
181 } 183 }
182 184
183 callbackCompleted(); 185 callbackCompleted();
184 }; 186 };
185 }; 187 };
(...skipping 21 matching lines...) Expand all
207 }; 209 };
208 210
209 event.addListener(listener); 211 event.addListener(listener);
210 return done; 212 return done;
211 }; 213 };
212 214
213 chrome.test.callbackPass = function(func) { 215 chrome.test.callbackPass = function(func) {
214 return chrome.test.callback(func); 216 return chrome.test.callback(func);
215 }; 217 };
216 218
217 chrome.test.callbackFail = function(expectedError) { 219 chrome.test.callbackFail = function(expectedError, func) {
218 return chrome.test.callback(null, expectedError); 220 return chrome.test.callback(func, expectedError);
219 }; 221 };
220 222
221 chrome.test.runTests = function(tests) { 223 chrome.test.runTests = function(tests) {
222 chrome.test.tests = tests; 224 chrome.test.tests = tests;
223 chrome.test.runNextTest(); 225 chrome.test.runNextTest();
224 }; 226 };
225 })(); 227 })();
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_bookmarks_module.cc ('k') | chrome/test/data/extensions/api_test/bookmarks/test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698