1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // TODO(dbeam): test for loading upacked extensions?
7 GEN('#include "chrome/browser/ui/webui/extensions/' +
8 'extension_settings_browsertest.h"');
11 * Test C++ fixture for settings WebUI testing.
13 * @extends {testing.Test}
15 function ExtensionSettingsUIBrowserTest() {}
18 * TestFixture for extension settings WebUI testing.
19 * @extends {testing.Test}
22 function ExtensionSettingsWebUITest() {}
24 ExtensionSettingsWebUITest
.prototype = {
25 __proto__
: testing
.Test
.prototype,
27 accessibilityIssuesAreErrors
: true,
31 // TODO(aboxhall): remove these when crbug.com/267035 is closed.
32 this.accessibilityAuditConfig
.ignoreSelectors(
33 'lowContrastElements',
34 '.enable-checkbox input:disabled + .enable-checkbox-text > *');
35 this.accessibilityAuditConfig
.ignoreSelectors(
36 'lowContrastElements', '.extension-description > *');
37 this.accessibilityAuditConfig
.ignoreSelectors(
38 'lowContrastElements', '.location-text');
42 * A URL to load before starting each test.
46 browsePreload
: 'chrome://extensions-frame/',
49 typedefCppFixture
: 'ExtensionSettingsUIBrowserTest',
52 TEST_F('ExtensionSettingsWebUITest', 'testChromeSendHandled', function() {
53 assertEquals(this.browsePreload
, document
.location
.href
);
55 // This dialog should be hidden at first.
56 assertFalse($('pack-extension-overlay').classList
.contains('showing'));
58 // Show the dialog, which triggers a chrome.send() for metrics purposes.
59 cr
.dispatchSimpleEvent($('pack-extension'), 'click');
60 assertTrue($('pack-extension-overlay').classList
.contains('showing'));
64 * TestFixture for extension settings WebUI testing (commands config edition).
65 * @extends {testing.Test}
68 function ExtensionSettingsCommandsConfigWebUITest() {}
70 ExtensionSettingsCommandsConfigWebUITest
.prototype = {
71 __proto__
: testing
.Test
.prototype,
73 accessibilityIssuesAreErrors
: true,
76 * A URL to load before starting each test.
80 browsePreload
: 'chrome://extensions-frame/configureCommands',
83 TEST_F('ExtensionSettingsCommandsConfigWebUITest', 'testChromeSendHandler',
85 // Just navigating to the page should trigger the chrome.send().
86 assertEquals(this.browsePreload
, document
.location
.href
);
87 assertTrue($('extension-commands-overlay').classList
.contains('showing'));
90 function ExtensionSettingsWebUITestWithExtensionInstalled() {}
92 ExtensionSettingsWebUITestWithExtensionInstalled
.prototype = {
93 __proto__
: ExtensionSettingsWebUITest
.prototype,
96 typedefCppFixture
: 'ExtensionSettingsUIBrowserTest',
99 testGenPreamble: function() {
100 GEN(' InstallGoodExtension();');
104 TEST_F('ExtensionSettingsWebUITestWithExtensionInstalled',
105 'baseAccessibilityIsOk', function() {
106 assertEquals(this.browsePreload
, document
.location
.href
);
107 this.runAccessibilityAudit();