OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var TEST_HISTORY_RESULTS = [ | 5 var TEST_HISTORY_RESULTS = [ |
6 createHistoryEntry('2016-03-16 10:00', 'http://www.google.com'), | 6 createHistoryEntry('2016-03-16 10:00', 'http://www.google.com'), |
7 createHistoryEntry('2016-03-16 9:00', 'http://www.example.com'), | 7 createHistoryEntry('2016-03-16 9:00', 'http://www.example.com'), |
8 createHistoryEntry('2016-03-16 7:01', 'http://www.badssl.com'), | 8 createHistoryEntry('2016-03-16 7:01', 'http://www.badssl.com'), |
9 createHistoryEntry('2016-03-16 7:00', 'http://www.website.com'), | 9 createHistoryEntry('2016-03-16 7:00', 'http://www.website.com'), |
10 createHistoryEntry('2016-03-16 4:00', 'http://www.website.com'), | 10 createHistoryEntry('2016-03-16 4:00', 'http://www.website.com'), |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 test('refocus checkbox on click', function() { | 48 test('refocus checkbox on click', function() { |
49 return PolymerTest.flushTasks().then(function() { | 49 return PolymerTest.flushTasks().then(function() { |
50 item.$['menu-button'].focus(); | 50 item.$['menu-button'].focus(); |
51 assertEquals(item.$['menu-button'], item.root.activeElement); | 51 assertEquals(item.$['menu-button'], item.root.activeElement); |
52 | 52 |
53 MockInteractions.tap(item.$['time-accessed']); | 53 MockInteractions.tap(item.$['time-accessed']); |
54 assertEquals(item.$['checkbox'], item.root.activeElement); | 54 assertEquals(item.$['checkbox'], item.root.activeElement); |
55 }); | 55 }); |
56 }); | 56 }); |
| 57 |
| 58 test('title changes with item', function() { |
| 59 var time = item.$['time-accessed']; |
| 60 assertEquals('', time.title); |
| 61 |
| 62 time.dispatchEvent(new CustomEvent('mouseover')); |
| 63 var initialTitle = time.title; |
| 64 item.item = TEST_HISTORY_RESULTS[5]; |
| 65 time.dispatchEvent(new CustomEvent('mouseover')); |
| 66 assertNotEquals(initialTitle, time.title); |
| 67 }); |
57 }); | 68 }); |
58 | 69 |
59 suite('<history-item> integration test', function() { | 70 suite('<history-item> integration test', function() { |
60 var element; | 71 var element; |
61 | 72 |
62 setup(function() { | 73 setup(function() { |
63 element = replaceApp().$.history; | 74 element = replaceApp().$.history; |
64 }); | 75 }); |
65 | 76 |
66 test('basic separator insertion', function() { | 77 test('basic separator insertion', function() { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 MockInteractions.tap(items[1].$$('#bookmark-star')); | 134 MockInteractions.tap(items[1].$$('#bookmark-star')); |
124 | 135 |
125 // Check that focus is shifted to overflow menu icon. | 136 // Check that focus is shifted to overflow menu icon. |
126 assertEquals(items[1].root.activeElement, items[1].$['menu-button']); | 137 assertEquals(items[1].root.activeElement, items[1].$['menu-button']); |
127 // Check that all items matching this url are unstarred. | 138 // Check that all items matching this url are unstarred. |
128 assertEquals(element.historyData_[1].starred, false); | 139 assertEquals(element.historyData_[1].starred, false); |
129 assertEquals(element.historyData_[5].starred, false); | 140 assertEquals(element.historyData_[5].starred, false); |
130 }); | 141 }); |
131 }); | 142 }); |
132 }); | 143 }); |
OLD | NEW |