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() {}; | |
| 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 * Tests that the Hung Render Dialog is working properly. | |
| 44 */ | |
| 45 TEST_F('HungRendererDialogUITest', 'testHungRenderer', function() { | |
| 46 // Confirm that the URL is correct. | |
| 47 assertEquals(chrome.expectedUrl, window.location.href); | |
| 48 | |
| 49 // Confirm that the theme graphic is loaded and is of a reasonable size. | |
| 50 // This validates that we are integrating properly with the theme source. | |
| 51 var themeGraphic = $('theme-graphic'); | |
| 52 assertNotEquals(null, themeGraphic); | |
| 53 assertGT(themeGraphic.width, 0); | |
|
flackr
2011/11/05 13:19:40
Use expect for checks that aren't fatal.
| |
| 54 assertGT(themeGraphic.height, 0); | |
|
flackr
2011/11/05 13:19:40
I think these themeGraphic checks should be in a s
wyck
2011/11/07 20:39:24
My thinking is that BrowserTests are expensive to
flackr
2011/11/07 21:00:13
I understand your point, however with both testabl
| |
| 55 | |
| 56 // Confirm that the DOM was updated such that a list item representing the | |
| 57 // frozen tab was added to the list of frozen tabs. | |
| 58 var tabTable = $('tab-table'); | |
| 59 assertNotEquals(null, tabTable); | |
| 60 assertGT(tabTable.childElementCount, 0); | |
| 61 | |
| 62 // Confirm that the list item text content is the title of the frozen tab. | |
| 63 var children = tabTable.getElementsByTagName('*'); | |
| 64 assertNotEquals(null, children); | |
| 65 var titleElement = children[0]; | |
| 66 assertNotEquals(null, titleElement); | |
| 67 assertEquals(chrome.expectedTitle, titleElement.textContent); | |
| 68 }); | |
| 69 | |
| OLD | NEW |