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

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

Issue 120733003: Feature detection-friendly restrictions for packaged apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed feedback. Created 6 years, 11 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 | « chrome/test/data/extensions/platform_apps/restrictions/sandboxed_iframe.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 function assertContains(string, substring, error) { 5 function assertContains(string, substring, error) {
6 chrome.test.assertTrue(string.indexOf(substring) != -1, error); 6 chrome.test.assertTrue(string.indexOf(substring) != -1, error);
7 } 7 }
8 8
9 chrome.test.runTests([ 9 chrome.test.runTests([
10 function testOpenDatabase() { 10 function testOpenDatabase() {
11 chrome.test.assertTrue(!window.openDatabase); 11 chrome.test.assertTrue(!window.openDatabase);
12 chrome.test.succeed(); 12 chrome.test.succeed();
13 }, 13 },
14 14
15 function testOpenDatabaseSync() { 15 function testOpenDatabaseSync() {
16 chrome.test.assertTrue(!window.openDatabaseSync); 16 chrome.test.assertTrue(!window.openDatabaseSync);
17 chrome.test.succeed(); 17 chrome.test.succeed();
18 }, 18 },
19 19
20 function testLocalStorage() { 20 function testLocalStorage() {
21 try { 21 chrome.test.assertTrue(!window.localStorage);
22 window.localStorage; 22 chrome.test.succeed();
23 chrome.test.fail('error not thrown');
24 } catch (e) {
25 var message = e.message || e;
26 var expected = 'is not available in packaged apps. ' +
27 'Use chrome.storage.local instead.';
28 assertContains(message, expected, 'Unexpected message ' + message);
29 chrome.test.succeed();
30 }
31 } 23 }
32 ]); 24 ]);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/platform_apps/restrictions/sandboxed_iframe.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698