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

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

Issue 9420041: Default parentId for bookmarks.create() (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 10 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/common/extensions/api/bookmarks.json ('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 a7440919b16fe1ac4a1d11f752a994d0e597d28c..e81843adb313ec65ec17e9da4cc1f7b012a50025 100644
--- a/chrome/test/data/extensions/api_test/bookmarks/test.js
+++ b/chrome/test/data/extensions/api_test/bookmarks/test.js
@@ -168,6 +168,25 @@ chrome.test.runTests([
}));
},
+ function createNoParentId() {
+ var node = {title:"google", url:"http://www.google.com/"};
+ chrome.test.listenOnce(chrome.bookmarks.onCreated, function(id, created) {
+ node.id = created.id;
+ node.index = 0;
+ chrome.test.assertEq(id, node.id);
+ // Make sure parentId defaults to Other Bookmarks
Devlin 2012/02/17 06:45:47 nit: comments should be grammatically correct (inc
cduvall 2012/02/17 07:01:35 Done.
+ chrome.test.assertEq(expected[0].children[1].id, created.parentId);
+ chrome.test.assertTrue(compareNode(node, created));
+ });
+ chrome.bookmarks.create(node, pass(function(results) {
+ node.id = results.id; // since we couldn't know this going in
+ node.index = 0;
+ chrome.test.assertTrue(compareNode(node, results),
+ "created node != source");
+ expected[0].children[0].children.push(node);
Devlin 2012/02/17 06:45:47 This seems like a lot of duplicate code....Is ther
cduvall 2012/02/17 07:01:35 The other tests (createInRoot(), create()) share a
+ }));
+ },
+
function createInRoot() {
const error = "Can't modify the root bookmark folders.";
var node = {parentId:"0", title:"g404", url:"http://www.google.com/404"};
« no previous file with comments | « chrome/common/extensions/api/bookmarks.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698