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

Unified Diff: chrome/test/data/webui/md_bookmarks/item_test.js

Issue 2603303002: [MD Bookmarks] Add UI for Material Bookmarks. (Closed)
Patch Set: change TODO position Created 3 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
Index: chrome/test/data/webui/md_bookmarks/item_test.js
diff --git a/chrome/test/data/webui/md_bookmarks/item_test.js b/chrome/test/data/webui/md_bookmarks/item_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..9e429bdd16700d2465fd20c3d1407741178f96d2
--- /dev/null
+++ b/chrome/test/data/webui/md_bookmarks/item_test.js
@@ -0,0 +1,32 @@
+// Copyright 2016 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.
+
+suite('<bookmarks-item>', function() {
+ var item;
+ var TEST_ITEM = {
+ id: '0', url: 'http://www.google.com'
+ };
+
+ setup(function() {
+ item = document.createElement('bookmarks-item');
+ replaceBody(item);
+ item.item = TEST_ITEM;
+ });
+
+ test('changing the url changes the favicon', function() {
+ var favicon = item.$.icon.style.backgroundImage;
+ item.set('item.url', 'http://www.mail.google.com');
+ assertNotEquals(favicon, item.$.icon.style.backgroundImage);
+ });
+
+ test('changing isFolder_ hides/unhides the folder/icon', function() {
+ item.isFolder_ = true;
+ assertFalse(item.$['folder-icon'].hidden);
+ assertTrue(item.$.icon.hidden);
+
+ item.isFolder_ = false;
+ assertTrue(item.$['folder-icon'].hidden);
+ assertFalse(item.$.icon.hidden);
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698