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

Side by Side Diff: chrome/test/data/extensions/api_test/bookmark_manager/edit_disabled/test.js

Issue 8759017: BookmarkModel cleanup. synced_node is now mobile_node and I'm nuking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to trunk fix sync_integration_tests and extension test Created 9 years 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/browser/ui/webui/ntp/bookmarks_handler.cc ('k') | net/tools/testserver/chromiumsync.py » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Bookmark Manager API test for Chrome. 5 // Bookmark Manager API test for Chrome.
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.BookmarkManagerEditDisabled 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.BookmarkManagerEditDisabled
7 7
8 const pass = chrome.test.callbackPass; 8 const pass = chrome.test.callbackPass;
9 const fail = chrome.test.callbackFail; 9 const fail = chrome.test.callbackFail;
10 const assertEq = chrome.test.assertEq; 10 const assertEq = chrome.test.assertEq;
11 const assertFalse = chrome.test.assertFalse; 11 const assertFalse = chrome.test.assertFalse;
12 const assertTrue = chrome.test.assertTrue; 12 const assertTrue = chrome.test.assertTrue;
13 const bookmarks = chrome.bookmarks; 13 const bookmarks = chrome.bookmarks;
14 const bookmarkManager = chrome.experimental.bookmarkManager; 14 const bookmarkManager = chrome.experimental.bookmarkManager;
15 15
16 var ERROR = "Bookmark editing is disabled."; 16 var ERROR = "Bookmark editing is disabled.";
17 17
18 // Bookmark model within this test: 18 // Bookmark model within this test:
19 // <root>/ 19 // <root>/
20 // Bookmarks Bar/ 20 // Bookmarks Bar/
21 // Folder/ 21 // Folder/
22 // "BBB" 22 // "BBB"
23 // "AAA" 23 // "AAA"
24 // Other Bookmarks/ 24 // Other Bookmarks/
25 // Mobile Bookmarks/
25 26
26 var tests = [ 27 var tests = [
27 function verifyModel() { 28 function verifyModel() {
28 bookmarks.getTree(pass(function(result) { 29 bookmarks.getTree(pass(function(result) {
29 assertEq(1, result.length); 30 assertEq(1, result.length);
30 var root = result[0]; 31 var root = result[0];
31 assertEq(2, root.children.length); 32 assertEq(3, root.children.length);
32 bar = root.children[0]; 33 bar = root.children[0];
33 assertEq(2, bar.children.length); 34 assertEq(2, bar.children.length);
34 folder = bar.children[0]; 35 folder = bar.children[0];
35 aaa = bar.children[1]; 36 aaa = bar.children[1];
36 assertEq('Folder', folder.title); 37 assertEq('Folder', folder.title);
37 assertEq('AAA', aaa.title); 38 assertEq('AAA', aaa.title);
38 bbb = folder.children[0]; 39 bbb = folder.children[0];
39 assertEq('BBB', bbb.title); 40 assertEq('BBB', bbb.title);
40 })); 41 }));
41 }, 42 },
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 }, 78 },
78 79
79 function editDisabled() { 80 function editDisabled() {
80 bookmarkManager.canEdit(pass(function(result) { 81 bookmarkManager.canEdit(pass(function(result) {
81 assertFalse(result, 'Should not be able to edit bookmarks'); 82 assertFalse(result, 'Should not be able to edit bookmarks');
82 })); 83 }));
83 } 84 }
84 ]; 85 ];
85 86
86 chrome.test.runTests(tests); 87 chrome.test.runTests(tests);
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/bookmarks_handler.cc ('k') | net/tools/testserver/chromiumsync.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698