summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui/options/managed_user_settings_browsertest.js
blob: 9eab3c66eb65238a82fed910b6137396e0ca9a82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) 2013 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.

GEN('#include "chrome/browser/ui/webui/options/' +
    'managed_user_settings_test.h"');

/**
 * Test fixture for managed user settings WebUI testing.
 * @constructor
 * @extends {testing.Test}
 */
function ManagedUserSettingsTest() {}

ManagedUserSettingsTest.prototype = {
  __proto__: testing.Test.prototype,

  /**
   * Browse to the managed user settings page .
   */
  browsePreload: 'chrome://settings-frame/managedUser',

  /** @override */
  typedefCppFixture: 'ManagedUserSettingsTest',

  /** @override */
  runAccessibilityChecks: false,

};

// Verify that the settings page is locked and can be unlocked.
TEST_F('ManagedUserSettingsTest', 'PageLocked',
    function() {
      var instance = ManagedUserSettings.getInstance();
      expectFalse(instance.isAuthenticated);
      // Now verify that the unlock button can be clicked.
      var unlockButton =
          options.ManagedUserSettingsForTesting.getUnlockButton();
      expectFalse(unlockButton.disabled);
      unlockButton.click();
      // When closing the page, we expect the elevation to be reset.
      OptionsPage.closeOverlay();
    });