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

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

Issue 320473002: Added the "unmodifiable" property to chrome.bookmarks.BookmarkTreeNode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaes Created 6 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/common/extensions/api/bookmarks.json ('k') | tools/json_schema_compiler/cc_generator.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) 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 // bookmarks api test 5 // bookmarks api test
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.Bookmarks 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.Bookmarks
7 7
8 // This is global state that is maintained across tests as a reference 8 // This is global state that is maintained across tests as a reference
9 // to compare against what's fetched from the browser (using compareTrees). 9 // to compare against what's fetched from the browser (using compareTrees).
10 // TODO(erikkay) It would be better if each test was self-contained and 10 // TODO(erikkay) It would be better if each test was self-contained and
11 // didn't depend on global state. 11 // didn't depend on global state.
12 var expected = [ 12 var expected = [
13 {"children": [ 13 {"children": [
14 {children:[], id:"1", parentId:"0", index:0, title:"Bookmarks bar"}, 14 {children:[], id:"1", parentId:"0", index:0, title:"Bookmarks bar"},
15 {children:[], id:"2", parentId:"0", index:1, title:"Other bookmarks"}, 15 {children:[], id:"2", parentId:"0", index:1, title:"Other bookmarks"},
16 {id:"4", parentId:"0", index:3, title:"Managed bookmarks", children:[ 16 {id:"4", parentId:"0", index:3, title:"Managed bookmarks",
17 unmodifiable:"managed", children:[
17 {id:"5", parentId:"4", index:0, title:"Managed Bookmark", 18 {id:"5", parentId:"4", index:0, title:"Managed Bookmark",
18 url: "http://www.chromium.org/"}, 19 url:"http://www.chromium.org/", unmodifiable:"managed"},
19 {id:"6", parentId:"4", index:1, title:"Managed Folder", children:[]} 20 {id:"6", parentId:"4", index:1, title:"Managed Folder",
21 children:[], unmodifiable:"managed"}
20 ] 22 ]
21 } 23 }
22 ], 24 ],
23 id:"0", title:"" 25 id:"0", title:""
24 } 26 }
25 ]; 27 ];
26 28
27 function bookmarksBar() { return expected[0].children[0]; } 29 function bookmarksBar() { return expected[0].children[0]; }
28 function otherBookmarks() { return expected[0].children[1]; } 30 function otherBookmarks() { return expected[0].children[1]; }
29 31
(...skipping 24 matching lines...) Expand all
54 if (left.title != right.title) { 56 if (left.title != right.title) {
55 // TODO(erikkay): This resource dependency still isn't working reliably. 57 // TODO(erikkay): This resource dependency still isn't working reliably.
56 // See bug 19866. 58 // See bug 19866.
57 // return "title mismatch: " + left.title + " != " + right.title; 59 // return "title mismatch: " + left.title + " != " + right.title;
58 chrome.test.log("title mismatch: " + left.title + " != " + right.title); 60 chrome.test.log("title mismatch: " + left.title + " != " + right.title);
59 } 61 }
60 if (left.url != right.url) 62 if (left.url != right.url)
61 return "url mismatch: " + left.url + " != " + right.url; 63 return "url mismatch: " + left.url + " != " + right.url;
62 if (left.index != right.index) 64 if (left.index != right.index)
63 return "index mismatch: " + left.index + " != " + right.index; 65 return "index mismatch: " + left.index + " != " + right.index;
66 if (left.unmodifiable != right.unmodifiable) {
67 return "unmodifiable mismatch: " + left.unmodifiable +
68 " != " + right.unmodifiable;
69 }
64 return true; 70 return true;
65 } 71 }
66 72
67 function compareTrees(left, right, verbose) { 73 function compareTrees(left, right, verbose) {
68 if (verbose) { 74 if (verbose) {
69 chrome.test.log(JSON.stringify(left) || "<null>"); 75 chrome.test.log(JSON.stringify(left) || "<null>");
70 chrome.test.log(JSON.stringify(right) || "<null>"); 76 chrome.test.log(JSON.stringify(right) || "<null>");
71 } 77 }
72 if (left == null && right == null) { 78 if (left == null && right == null) {
73 return true; 79 return true;
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 function(result) { 586 function(result) {
581 chrome.test.assertEq(newTitle, result.title); 587 chrome.test.assertEq(newTitle, result.title);
582 chrome.test.assertFalse('url' in result) 588 chrome.test.assertFalse('url' in result)
583 })); 589 }));
584 }); 590 });
585 } 591 }
586 ]); 592 ]);
587 } 593 }
588 594
589 run(); 595 run();
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/bookmarks.json ('k') | tools/json_schema_compiler/cc_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698