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

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: Added description of what parentId will default to. 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..cc7f6b896e06d2c90ab975c5b91d721fea0b38a1 100644
--- a/chrome/test/data/extensions/api_test/bookmarks/test.js
+++ b/chrome/test/data/extensions/api_test/bookmarks/test.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -168,6 +168,24 @@ 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 the parentId defaults to the Other Bookmarks folder.
+ 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");
+ }));
+ },
+
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