| Index: chrome/test/data/extensions/api_test/bookmarks/test.js
|
| diff --git a/chrome/test/data/extensions/api_test/bookmarks/test.js b/chrome/test/data/extensions/api_test/bookmarks/test.js
|
| index 4e6b04b4c51cc34aed8c485e1365597e4cd99488..394cbdcb2a5320ccedc2f721148f3b570765f1fc 100644
|
| --- a/chrome/test/data/extensions/api_test/bookmarks/test.js
|
| +++ b/chrome/test/data/extensions/api_test/bookmarks/test.js
|
| @@ -22,11 +22,11 @@ function bookmarksBar() { return expected[0].children[0]; }
|
| function otherBookmarks() { return expected[0].children[1]; }
|
|
|
| // Some variables that are used across multiple tests.
|
| -var node1 = {parentId:"1", title:"Foo bar baz",
|
| +var node1 = {parentId:"1", title:"bar baz",
|
| url:"http://www.example.com/hello"};
|
| var node2 = {parentId:"1", title:"foo quux",
|
| url:"http://www.example.com/bar"};
|
| -var node3 = {parentId:"1", title:"bar baz",
|
| +var node3 = {parentId:"1", title:"Foo bar baz",
|
| url:"http://www.google.com/hello/quux"};
|
| var quota_node1 = {parentId:"1", title:"Dave",
|
| url:"http://www.dmband.com/"};
|
| @@ -301,13 +301,17 @@ chrome.test.runTests([
|
| chrome.test.assertEq(1, results.length);
|
| }));
|
| chrome.bookmarks.search("foo bar", pass(function(results) {
|
| - // matches node1 & folder "foo bar" from createFolder
|
| + // matches node3 & folder "foo bar" from createFolder
|
| chrome.test.assertEq(2, results.length);
|
| }));
|
| chrome.bookmarks.search("quux", pass(function(results) {
|
| - // matches node2 & node3
|
| + // matches node2 & node1
|
| chrome.test.assertEq(2, results.length);
|
| }));
|
| + chrome.bookmarks.search("Bookmark Bar", pass(function(results) {
|
| + // Does not match any node since permanent nodes are stripped from search
|
| + chrome.test.assertEq(0, results.length);
|
| + }));
|
| },
|
|
|
| function update() {
|
| @@ -364,11 +368,18 @@ chrome.test.runTests([
|
| expected[0].children[1].children[1].children.shift();
|
| expected[0].children[1].children[1].children[0].index = 0;
|
| expected[0].children[1].children[1].children[1].index = 1;
|
| -
|
| verifyTreeIsExpected(pass());
|
| }));
|
| },
|
|
|
| + function searchRemoved() {
|
| + // Search for deleted node
|
| + chrome.bookmarks.search("baz bar", pass(function(results) {
|
| + // matches only node3 since node1 was removed
|
| + chrome.test.assertEq(1, results.length);
|
| + }));
|
| + },
|
| +
|
| function removeTree() {
|
| var parentId = node2.parentId;
|
| var folder = expected[0].children[1].children[1];
|
| @@ -385,6 +396,14 @@ chrome.test.runTests([
|
| }));
|
| },
|
|
|
| + function searchRemovedTree() {
|
| + // Search for deleted folder and enclosed node3
|
| + chrome.bookmarks.search("foo bar", pass(function(results) {
|
| + // Does not match anything since folder was removed with node3 in it
|
| + chrome.test.assertEq(0, results.length);
|
| + }));
|
| + },
|
| +
|
| function quotaLimitedCreate() {
|
| var node = {parentId:"1", title:"quotacreate", url:"http://www.quota.com/"};
|
| for (i = 0; i < 100; i++) {
|
| @@ -451,11 +470,11 @@ chrome.test.runTests([
|
| expected = results;
|
|
|
| // Reset the nodes
|
| - node1 = {parentId:"1", title:"Foo bar baz",
|
| + node1 = {parentId:"1", title:"bar baz",
|
| url:"http://www.example.com/hello"};
|
| node2 = {parentId:"1", title:"foo quux",
|
| url:"http://www.example.com/bar"};
|
| - node3 = {parentId:"1", title:"bar baz",
|
| + node3 = {parentId:"1", title:"Foo bar baz",
|
| url:"http://www.google.com/hello/quux"};
|
| createNodes(bookmarksBar(), [node1, node2, node3], pass(function() {
|
| verifyTreeIsExpected(pass());
|
|
|