Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 6 * Test fixture for generated tests. | |
| 7 * @extends {testing.Test} | |
| 8 */ | |
| 9 function HungRendererDialogUITest() {}; | |
| 10 | |
| 11 HungRendererDialogUITest.prototype = { | |
| 12 __proto__: testing.Test.prototype, | |
| 13 | |
| 14 /** | |
| 15 * Define the C++ fixture class and include it. | |
| 16 * @type {?string} | |
| 17 * @override | |
| 18 */ | |
| 19 typedefCppFixture: 'HungRendererDialogUITest', | |
| 20 }; | |
| 21 | |
| 22 /** | |
| 23 * Test fixture for asynchronous tests. | |
| 24 * @extends {HungRendererDialogUITest} | |
| 25 */ | |
| 26 function HungRendererDialogUITestAsync() {}; | |
|
flackr
2011/11/07 21:00:14
This seems to be unused, remove please.
| |
| 27 | |
| 28 HungRendererDialogUITestAsync.prototype = { | |
| 29 __proto__: HungRendererDialogUITest.prototype, | |
| 30 | |
| 31 /** @inheritDoc */ | |
| 32 isAsync: true, | |
| 33 }; | |
| 34 | |
| 35 // Include the bulk of c++ code. | |
| 36 GEN('#include "chrome/test/data/webui/hung_renderer_dialog_ui_test-inl.h"'); | |
| 37 | |
| 38 // Constructors and destructors must be provided in .cc to prevent clang errors. | |
| 39 GEN('HungRendererDialogUITest::HungRendererDialogUITest() {}'); | |
| 40 GEN('HungRendererDialogUITest::~HungRendererDialogUITest() {}'); | |
| 41 | |
| 42 /** | |
| 43 * Confirms that the URL is correct. | |
| 44 */ | |
| 45 TEST_F('HungRendererDialogUITest', 'testURL', function() { | |
| 46 expectEquals(chrome.expectedUrl, window.location.href); | |
| 47 }); | |
| 48 | |
| 49 /** | |
| 50 * Confirms that the theme graphic is loaded and is of a reasonable size. This | |
| 51 * validates that we are integrating properly with the theme source. | |
| 52 */ | |
| 53 TEST_F('HungRendererDialogUITest', 'testThemeGraphicIntegration', function() { | |
| 54 var themeGraphic = $('theme-graphic'); | |
| 55 assertNotEquals(null, themeGraphic); | |
| 56 expectGT(themeGraphic.width, 0); | |
| 57 expectGT(themeGraphic.height, 0); | |
| 58 }); | |
| 59 | |
| 60 /** | |
| 61 * Confirms that the DOM was updated such that a list item representing the | |
| 62 * frozen tab was added to the list of frozen tabs. Also confirms that the list | |
| 63 * item text content is the title of the frozen tab. | |
| 64 */ | |
| 65 TEST_F('HungRendererDialogUITest', 'testHungRenderer', function() { | |
| 66 var tabTable = $('tab-table'); | |
| 67 assertNotEquals(null, tabTable); | |
| 68 assertGT(tabTable.childElementCount, 0); | |
| 69 | |
| 70 var children = tabTable.getElementsByTagName('*'); | |
| 71 assertNotEquals(null, children); | |
| 72 var titleElement = children[0]; | |
| 73 assertNotEquals(null, titleElement); | |
| 74 expectEquals(chrome.expectedTitle, titleElement.textContent); | |
| 75 }); | |
| 76 | |
| OLD | NEW |