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

Unified Diff: chrome/test/data/extensions/api_test/bookmarks/test.js

Issue 102713002: Support folders in bookmark search (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve conflicts with master + .cc handling of clipboard 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/bookmark_manager/js/main.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « chrome/browser/resources/bookmark_manager/js/main.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698