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..a8405ae565a9a387d61e50a749787abd2bd4b55f |
| --- /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 supervised-user', function() { |
| + var element; |
| + |
| + suiteSetup(function() { |
| + element = $('history-card-manager'); |
| + }); |
| + |
| + test('checkboxes disabled for supervised user', function() { |
| + element.addNewResults(TEST_HISTORY_RESULTS); |
| + var toolbar = $('toolbar'); |
| + |
| + flush(function() { |
|
tsergeant
2016/02/01 22:47:53
If you're using flush, then you need done()
hsampson
2016/02/02 00:45:10
Done.
|
| + 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 disabled for supervised user', function() { |
| + element.addNewResults(TEST_HISTORY_RESULTS); |
| + |
| + // Make sure that removeVisits is not being called. |
| + registerMessageCallback('removeVisits', this, function (toBeRemoved) { |
| + assertTrue(false); |
| + }); |
| + |
| + element.historyDataByDay_[0].historyItems[0].selected = true; |
| + $('toolbar').deleteSelection(); |
| + }); |
| + |
| + teardown(function() { |
| + element.historyDataByDay_ = []; |
| + }); |
| + }); |
| + } |
| + return { |
| + registerTests: registerTests |
| + }; |
| +}); |