Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Unified Diff: chrome/test/data/webui/md_history/history_supervised_user_test.js

Issue 1586373002: MD History: Delete button in the toolbar allows deletion of multiple history-items. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patch_to_be_uploaded
Patch Set: Fix supervised user test. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..fe05875e09b993d25c13db38e94dcc9e5951cea8
--- /dev/null
+++ b/chrome/test/data/webui/md_history/history_supervised_user_test.js
@@ -0,0 +1,57 @@
+// 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(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);
+ done();
+ });
+ });
+
+ 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').onDeleteTap_();
+ });
+
+ teardown(function() {
+ element.historyDataByDay_ = [];
+ });
+ });
+ }
+ return {
+ registerTests: registerTests
+ };
+});
« no previous file with comments | « chrome/test/data/webui/md_history/history_card_test.js ('k') | chrome/test/data/webui/md_history/md_history_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698