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

Unified Diff: chrome/browser/ui/webui/workers_ui_browsertest.cc

Issue 7388020: Add sanity test for chrome://workers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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
« no previous file with comments | « no previous file | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/workers_ui_browsertest.cc
diff --git a/chrome/browser/ui/webui/workers_ui_browsertest.cc b/chrome/browser/ui/webui/workers_ui_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f2b8217076489483e26cfac85cf933f8395262dc
--- /dev/null
+++ b/chrome/browser/ui/webui/workers_ui_browsertest.cc
@@ -0,0 +1,56 @@
+// 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.
+
+#include "chrome/test/in_process_browser_test.h"
+#include "chrome/test/ui_test_utils.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/common/url_constants.h"
+#include "content/browser/tab_contents/navigation_details.h"
+#include "content/browser/tab_contents/tab_contents.h"
+
+namespace {
+
+const char kSharedWorkerTestPage[] =
+ "files/workers/workers_ui_shared_worker.html";
+const char kSharedWorkerJs[] =
+ "files/workers/workers_ui_shared_worker.js";
+
+class WorkersUITest : public InProcessBrowserTest {
+ public:
+ WorkersUITest() {
+ set_show_window(true);
+ EnableDOMAutomation();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WorkersUITest);
+};
+
+IN_PROC_BROWSER_TEST_F(WorkersUITest, SharedWorkersList) {
+ ASSERT_TRUE(test_server()->Start());
+ GURL url = test_server()->GetURL(kSharedWorkerTestPage);
+ ui_test_utils::NavigateToURL(browser(), url);
+
+ ui_test_utils::NavigateToURLWithDisposition(
+ browser(),
+ GURL(chrome::kChromeUIWorkersURL),
+ NEW_FOREGROUND_TAB,
+ ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
+
+ TabContents* tab_contents = browser()->GetSelectedTabContents();
+ ASSERT_TRUE(tab_contents != NULL);
+
+ std::string result;
+ ASSERT_TRUE(
+ ui_test_utils::ExecuteJavaScriptAndExtractString(
+ tab_contents->render_view_host(),
+ L"",
+ L"window.domAutomationController.send("
+ L"'' + document.getElementsByTagName('td')[1].textContent);",
+ &result));
+ ASSERT_TRUE(result.find(kSharedWorkerJs) != std::string::npos);
+}
+
+} // namespace
+
« no previous file with comments | « no previous file | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698