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 cr.define('md_history.history_synced_tabs_test', function() { | 5 cr.define('md_history.history_synced_tabs_test', function() { |
6 function createSession(name, windows) { | 6 function createSession(name, windows) { |
7 return { | 7 return { |
8 collapsed: false, | 8 collapsed: false, |
9 deviceType: '', | 9 deviceType: '', |
10 name: name, | 10 name: name, |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 ]; | 155 ]; |
156 setForeignSessions(sessionList, true); | 156 setForeignSessions(sessionList, true); |
157 | 157 |
158 return flush().then(function() { | 158 return flush().then(function() { |
159 var cards = getCards(); | 159 var cards = getCards(); |
160 assertEquals(2, cards.length); | 160 assertEquals(2, cards.length); |
161 | 161 |
162 // Ensure separators between windows are added appropriately. | 162 // Ensure separators between windows are added appropriately. |
163 assertEquals(1, numWindowSeparators(cards[0])); | 163 assertEquals(1, numWindowSeparators(cards[0])); |
164 assertEquals(3, numWindowSeparators(cards[1])); | 164 assertEquals(3, numWindowSeparators(cards[1])); |
165 element.searchedTerm = 'g'; | 165 element.searchTerm = 'g'; |
166 | 166 |
167 return flush(); | 167 return flush(); |
168 }).then(function() { | 168 }).then(function() { |
169 var cards = getCards(); | 169 var cards = getCards(); |
170 | 170 |
171 assertEquals(1, numWindowSeparators(cards[0])); | 171 assertEquals(1, numWindowSeparators(cards[0])); |
172 assertEquals(1, cards[0].tabs.length); | 172 assertEquals(1, cards[0].tabs.length); |
173 assertEquals('http://www.google.com', cards[0].tabs[0].title); | 173 assertEquals('http://www.google.com', cards[0].tabs[0].title); |
174 assertEquals(2, numWindowSeparators(cards[1])); | 174 assertEquals(2, numWindowSeparators(cards[1])); |
175 assertEquals(3, cards[1].tabs.length); | 175 assertEquals(3, cards[1].tabs.length); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 updateSignInState(false); | 248 updateSignInState(false); |
249 return flush(); | 249 return flush(); |
250 }).then(function() { | 250 }).then(function() { |
251 // When user signs out, don't show the message. | 251 // When user signs out, don't show the message. |
252 assertTrue(element.$['no-synced-tabs'].hidden); | 252 assertTrue(element.$['no-synced-tabs'].hidden); |
253 }); | 253 }); |
254 }); | 254 }); |
255 | 255 |
256 teardown(function() { | 256 teardown(function() { |
257 element.syncedDevices = []; | 257 element.syncedDevices = []; |
258 element.searchedTerm = ''; | 258 element.searchTerm = ''; |
259 }); | 259 }); |
260 }); | 260 }); |
261 } | 261 } |
262 return { | 262 return { |
263 registerTests: registerTests | 263 registerTests: registerTests |
264 }; | 264 }; |
265 }); | 265 }); |
OLD | NEW |