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

Unified Diff: chrome/test/data/webui/print_preview/print_preview_ui_browsertest.js

Issue 2887003002: Print Preview: Migrate some JS tests to use Mocha. (Closed)
Patch Set: Replace more Created 3 years, 7 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/print_preview/print_preview_ui_browsertest.js
diff --git a/chrome/test/data/webui/print_preview/print_preview_ui_browsertest.js b/chrome/test/data/webui/print_preview/print_preview_ui_browsertest.js
new file mode 100644
index 0000000000000000000000000000000000000000..3b678f603f92aafb09327188193eb8d9f8a74680
--- /dev/null
+++ b/chrome/test/data/webui/print_preview/print_preview_ui_browsertest.js
@@ -0,0 +1,83 @@
+// Copyright 2017 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.
+
+/** @fileoverview Runs the Print Preview tests. */
+
+var ROOT_PATH = '../../../../../';
+
+/**
+ * @constructor
+ * @extends {testing.Test}
+ */
+function PrintPreviewUIBrowserTest() {}
+
+PrintPreviewUIBrowserTest.prototype = {
+ __proto__: testing.Test.prototype,
+
+ /**
+ * Browse to the sample page, cause print preview & call preLoad().
+ * @override
+ */
+ browsePrintPreload: 'print_preview/print_preview_hello_world_test.html',
+
+ /** @override */
+ runAccessibilityChecks: true,
+
+ /** @override */
+ accessibilityIssuesAreErrors: false,
+
+ /** @override */
+ isAsync: true,
+
+ /** @override */
+ preLoad: function() {
+ window.isTest = true;
+ testing.Test.prototype.preLoad.call(this);
+
+ },
+
+ /** @override */
+ setUp: function() {
+ testing.Test.prototype.setUp.call(this);
+
+ testing.Test.disableAnimationsAndTransitions();
+ // Enable when failure is resolved.
+ // AX_TEXT_03: http://crbug.com/559209
+ this.accessibilityAuditConfig.ignoreSelectors(
+ 'multipleLabelableElementsPerLabel',
+ '#page-settings > .right-column > *');
+ },
+
+ extraLibraries: [
+ ROOT_PATH + 'ui/webui/resources/js/cr.js',
+ ROOT_PATH + 'ui/webui/resources/js/promise_resolver.js',
+ ROOT_PATH + 'third_party/mocha/mocha.js',
+ ROOT_PATH + 'chrome/test/data/webui/mocha_adapter.js',
+ ROOT_PATH + 'ui/webui/resources/js/util.js',
+ ROOT_PATH + 'chrome/test/data/webui/settings/test_browser_proxy.js',
+ 'print_preview_tests.js',
+ 'native_layer_stub.js',
+ ],
+};
+
+TEST_F('PrintPreviewUIBrowserTest', 'PrinterList', function() {
+ mocha.grep(/PrinterList\b/).run();
+});
+
+TEST_F('PrintPreviewUIBrowserTest', 'PrinterListCloudEmpty', function() {
+ mocha.grep(/PrinterListCloudEmpty\b/).run();
+});
+
+TEST_F('PrintPreviewUIBrowserTest', 'RestoreLocalDestination', function() {
+ mocha.grep(/RestoreLocalDestination\b/).run();
+});
+
+TEST_F('PrintPreviewUIBrowserTest', 'RestoreMultipleDestinations', function() {
+ mocha.grep(/RestoreMultipleDestinations\b/).run();
+});
+
+TEST_F('PrintPreviewUIBrowserTest', 'DefaultDestinationSelectionRules',
+ function() {
+ mocha.grep(/DefaultDestinationSelectionRules\b/).run();
+ });

Powered by Google App Engine
This is Rietveld 408576698