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

Unified Diff: chrome/test/data/webui/hung_renderer_dialog_test.js

Issue 8372042: Tests for WebUI Hung Renderer Dialog (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: more self review Created 9 years, 1 month 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
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/webui/hung_renderer_dialog_ui_test-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/hung_renderer_dialog_test.js
diff --git a/chrome/test/data/webui/hung_renderer_dialog_test.js b/chrome/test/data/webui/hung_renderer_dialog_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..06651cda87efbcff7f09860d809f5b2dac8a818f
--- /dev/null
+++ b/chrome/test/data/webui/hung_renderer_dialog_test.js
@@ -0,0 +1,69 @@
+// Copyright (c) 2011 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.
+
+/**
+ * Test fixture for generated tests.
+ * @extends {testing.Test}
+ */
+function HungRendererDialogUITest() {};
+
+HungRendererDialogUITest.prototype = {
+ __proto__: testing.Test.prototype,
+
+ /**
+ * Define the C++ fixture class and include it.
+ * @type {?string}
+ * @override
+ */
+ typedefCppFixture: 'HungRendererDialogUITest',
+};
+
+/**
+ * Test fixture for asynchronous tests.
+ * @extends {HungRendererDialogUITest}
+ */
+function HungRendererDialogUITestAsync() {};
+
+HungRendererDialogUITestAsync.prototype = {
+ __proto__: HungRendererDialogUITest.prototype,
+
+ /** @inheritDoc */
+ isAsync: true,
+};
+
+// Include the bulk of c++ code.
+GEN('#include "chrome/test/data/webui/hung_renderer_dialog_ui_test-inl.h"');
+
+// Constructors and destructors must be provided in .cc to prevent clang errors.
+GEN('HungRendererDialogUITest::HungRendererDialogUITest() {}');
+GEN('HungRendererDialogUITest::~HungRendererDialogUITest() {}');
+
+/**
+ * Tests that the Hung Render Dialog is working properly.
+ */
+TEST_F('HungRendererDialogUITest', 'testHungRenderer', function() {
+ // Confirm that the URL is correct.
+ assertEquals(chrome.expectedUrl, window.location.href);
+
+ // Confirm that the theme graphic is loaded and is of a reasonable size.
+ // This validates that we are integrating properly with the theme source.
+ var themeGraphic = $('theme-graphic');
+ assertNotEquals(null, themeGraphic);
+ assertGT(themeGraphic.width, 0);
flackr 2011/11/05 13:19:40 Use expect for checks that aren't fatal.
+ 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
+
+ // Confirm that the DOM was updated such that a list item representing the
+ // frozen tab was added to the list of frozen tabs.
+ var tabTable = $('tab-table');
+ assertNotEquals(null, tabTable);
+ assertGT(tabTable.childElementCount, 0);
+
+ // Confirm that the list item text content is the title of the frozen tab.
+ var children = tabTable.getElementsByTagName('*');
+ assertNotEquals(null, children);
+ var titleElement = children[0];
+ assertNotEquals(null, titleElement);
+ assertEquals(chrome.expectedTitle, titleElement.textContent);
+});
+
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/webui/hung_renderer_dialog_ui_test-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698