| 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_toolbar_test', function() { | 5 cr.define('md_history.history_toolbar_test', function() { |
| 6 function registerTests() { | 6 function registerTests() { |
| 7 suite('history-toolbar', function() { | 7 suite('history-toolbar', function() { |
| 8 var element; | 8 var element; |
| 9 var toolbar; | 9 var toolbar; |
| 10 var TEST_HISTORY_RESULTS; | 10 var TEST_HISTORY_RESULTS; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 done(); | 48 done(); |
| 49 }); | 49 }); |
| 50 | 50 |
| 51 toolbar.onSearch('Test'); | 51 toolbar.onSearch('Test'); |
| 52 }); | 52 }); |
| 53 | 53 |
| 54 test('more from this site sends and sets correct data', function(done) { | 54 test('more from this site sends and sets correct data', function(done) { |
| 55 registerMessageCallback('queryHistory', this, function (info) { | 55 registerMessageCallback('queryHistory', this, function (info) { |
| 56 assertEquals('example.com', info[0]); | 56 assertEquals('example.com', info[0]); |
| 57 flush(function() { | 57 flush(function() { |
| 58 assertEquals(toolbar.$$('#search-input').$$('#search-input').value, | 58 assertEquals( |
| 59 'example.com'); | 59 'example.com', |
| 60 toolbar.$['main-toolbar'].getSearchField().getValue()); |
| 60 done(); | 61 done(); |
| 61 }); | 62 }); |
| 62 }); | 63 }); |
| 63 | 64 |
| 64 element.$.sharedMenu.itemData = {domain: 'example.com'}; | 65 element.$.sharedMenu.itemData = {domain: 'example.com'}; |
| 65 MockInteractions.tap(element.$.menuMoreButton); | 66 MockInteractions.tap(element.$.menuMoreButton); |
| 66 }); | 67 }); |
| 67 | 68 |
| 68 teardown(function() { | 69 teardown(function() { |
| 69 element.historyData_ = []; | 70 element.historyData_ = []; |
| 70 element.searchedTerm = ''; | 71 element.searchedTerm = ''; |
| 71 registerMessageCallback('queryHistory', this, undefined); | 72 registerMessageCallback('queryHistory', this, undefined); |
| 72 toolbar.count = 0; | 73 toolbar.count = 0; |
| 73 }); | 74 }); |
| 74 }); | 75 }); |
| 75 } | 76 } |
| 76 return { | 77 return { |
| 77 registerTests: registerTests | 78 registerTests: registerTests |
| 78 }; | 79 }; |
| 79 }); | 80 }); |
| OLD | NEW |