OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Test fixture for print preview WebUI testing. | 6 * Test fixture for print preview WebUI testing. |
7 * @extends {testing.Test} | 7 * @extends {testing.Test} |
8 * @constructor | 8 * @constructor |
9 */ | 9 */ |
10 function PrintPreviewWebUITest() {} | 10 function PrintPreviewWebUITest() {} |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 /** | 157 /** |
158 * Always return true so tests run on systems without plugin available. | 158 * Always return true so tests run on systems without plugin available. |
159 * @return {boolean} Always true. | 159 * @return {boolean} Always true. |
160 */ | 160 */ |
161 checkCompatiblePluginExists: function() { | 161 checkCompatiblePluginExists: function() { |
162 return true; | 162 return true; |
163 }, | 163 }, |
164 }; | 164 }; |
165 | 165 |
166 GEN('#include "base/command_line.h"'); | 166 GEN('#include "chrome/test/data/webui/print_preview.h"'); |
167 GEN('#include "chrome/browser/ui/webui/web_ui_browsertest.h"'); | |
168 GEN('#include "chrome/common/chrome_switches.h"'); | |
169 GEN(''); | |
170 GEN('class PrintPreviewWebUITest'); | |
171 GEN(' : public WebUIBrowserTest {'); | |
172 GEN(' protected:'); | |
173 GEN(' // WebUIBrowserTest override.'); | |
174 GEN(' virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {'); | |
175 GEN(' WebUIBrowserTest::SetUpCommandLine(command_line);'); | |
176 GEN(' command_line->AppendSwitch(switches::kEnablePrintPreview);'); | |
177 GEN(' }'); | |
178 GEN(''); | |
179 GEN('};'); | |
180 GEN(''); | |
181 | 167 |
182 /** | 168 /** |
183 * The expected length of the |printer-list| element. | 169 * The expected length of the |printer-list| element. |
184 * @type {number} | 170 * @type {number} |
185 * @const | 171 * @const |
186 */ | 172 */ |
187 var printerListMinLength = 2; | 173 var printerListMinLength = 2; |
188 | 174 |
189 /** | 175 /** |
190 * The expected index of the "foo" printer returned by the stubbed handler. | 176 * The expected index of the "foo" printer returned by the stubbed handler. |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 | 399 |
414 // Test that error message is displayed when plugin doesn't exist. | 400 // Test that error message is displayed when plugin doesn't exist. |
415 TEST_F('PrintPreviewNoPDFWebUITest', 'TestErrorMessage', function() { | 401 TEST_F('PrintPreviewNoPDFWebUITest', 'TestErrorMessage', function() { |
416 var errorButton = $('error-button'); | 402 var errorButton = $('error-button'); |
417 assertNotEquals(null, errorButton); | 403 assertNotEquals(null, errorButton); |
418 expectFalse(errorButton.disabled); | 404 expectFalse(errorButton.disabled); |
419 var errorText = $('custom-message'); | 405 var errorText = $('custom-message'); |
420 assertNotEquals(null, errorText); | 406 assertNotEquals(null, errorText); |
421 expectFalse(errorText.hidden); | 407 expectFalse(errorText.hidden); |
422 }); | 408 }); |
OLD | NEW |