Chromium Code Reviews| Index: chrome/test/data/webui/md_history/history_supervised_user_test.js |
| diff --git a/chrome/test/data/webui/md_history/history_supervised_user_test.js b/chrome/test/data/webui/md_history/history_supervised_user_test.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..702229de26a6a071332a5ad3f3830acd46977450 |
| --- /dev/null |
| +++ b/chrome/test/data/webui/md_history/history_supervised_user_test.js |
| @@ -0,0 +1,56 @@ |
| +// 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. |
| + |
| +cr.define('md_history.history_supervised_user_test', function() { |
| + // Array of test history data. |
| + var TEST_HISTORY_RESULTS = [ |
| + { |
| + "dateRelativeDay": "Today - Wednesday, December 9, 2015", |
| + "url": "https://www.google.com" |
| + } |
| + ]; |
| + |
| + function registerTests() { |
| + suite('history-card-manager', function() { |
|
tsergeant
2016/01/25 01:43:15
Suite name should reflect that these are supervise
hsampson
2016/01/25 04:15:42
Done.
|
| + var element; |
| + |
| + suiteSetup(function() { |
| + element = $('history-card-manager'); |
| + }); |
| + |
| + test('display for supervised user', function() { |
|
tsergeant
2016/01/25 01:43:15
The actual *test* here is whether the checkboxes a
hsampson
2016/01/25 04:15:42
Done.
|
| + element.addNewResults(TEST_HISTORY_RESULTS); |
| + var toolbar = $('toolbar'); |
| + |
| + flush(function() { |
| + var card = Polymer.dom(element.root).querySelectorAll('history-card'); |
| + var item = Polymer.dom(card[0].root).querySelectorAll('history-item'); |
| + |
| + MockInteractions.tap(item[0].$['checkbox']); |
| + |
| + assertFalse(item[0].selected); |
| + }); |
| + }); |
| + |
| + test('deletion for supervised user', function() { |
| + element.addNewResults(TEST_HISTORY_RESULTS); |
| + |
| + // Make sure that removeVisits is not being called. |
| + registerMessageCallback('removeVisits', this, function (toBeRemoved) { |
| + assertEquals(toBeRemoved, []); |
|
tsergeant
2016/01/25 01:43:15
If you want to make sure something is never called
hsampson
2016/01/25 04:15:42
Done.
|
| + }); |
| + |
| + element.historyDataByDay_[0].historyItems[0].selected = true; |
| + $('toolbar').deleteSelection(); |
| + }); |
| + |
| + teardown(function() { |
| + element.historyDataByDay_ = []; |
| + }); |
| + }); |
| + } |
| + return { |
| + registerTests: registerTests |
| + }; |
| +}); |