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

Unified Diff: chrome/test/data/extensions/platform_apps/restrictions/test.js

Issue 10443047: Disable synchronous XMLHttpRequests in platform app documents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_webkit_preferences.cc ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/platform_apps/restrictions/test.js
diff --git a/chrome/test/data/extensions/platform_apps/restrictions/test.js b/chrome/test/data/extensions/platform_apps/restrictions/test.js
index 25008d6f41bf21483569cf84858648e9afe3a8bd..25b45f9646e17826ece0c8b0a33203de8c417df5 100644
--- a/chrome/test/data/extensions/platform_apps/restrictions/test.js
+++ b/chrome/test/data/extensions/platform_apps/restrictions/test.js
@@ -6,14 +6,14 @@ var assertEq = chrome.test.assertEq;
var fail = chrome.test.fail;
var succeed = chrome.test.succeed;
-var error = "Not available for platform apps.";
+var DEFAULT_EXPECTED_ERROR = "Not available for platform apps.";
-function assertThrowsError(method) {
+function assertThrowsError(method, opt_expectedError) {
try {
method();
fail("error not thrown");
} catch (e) {
- assertEq(e, error);
+ assertEq(e.message || e, opt_expectedError || DEFAULT_EXPECTED_ERROR);
}
}
@@ -113,5 +113,13 @@ chrome.test.runTests([
});
}
succeed();
+ },
+
+ function testSyncXhr() {
+ var xhr = new XMLHttpRequest();
+ assertThrowsError(function() {
+ xhr.open('GET', 'data:should not load', false);
+ }, 'INVALID_ACCESS_ERR: DOM Exception 15');
+ succeed();
}
]);
« no previous file with comments | « chrome/browser/extensions/extension_webkit_preferences.cc ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698