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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #include "chrome/test/in_process_browser_test.h"
6 #include "chrome/test/ui_test_utils.h"
7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/common/url_constants.h"
9 #include "content/browser/tab_contents/navigation_details.h"
10 #include "content/browser/tab_contents/tab_contents.h"
11
12 namespace {
13
14 const char kSharedWorkerTestPage[] =
15 "files/workers/workers_ui_shared_worker.html";
16 const char kSharedWorkerJs[] =
17 "files/workers/workers_ui_shared_worker.js";
18
19 class WorkersUITest : public InProcessBrowserTest {
20 public:
21 WorkersUITest() {
22 set_show_window(true);
23 EnableDOMAutomation();
24 }
25
26 private:
27 DISALLOW_COPY_AND_ASSIGN(WorkersUITest);
28 };
29
30 IN_PROC_BROWSER_TEST_F(WorkersUITest, SharedWorkersList) {
31 ASSERT_TRUE(test_server()->Start());
32 GURL url = test_server()->GetURL(kSharedWorkerTestPage);
33 ui_test_utils::NavigateToURL(browser(), url);
34
35 ui_test_utils::NavigateToURLWithDisposition(
36 browser(),
37 GURL(chrome::kChromeUIWorkersURL),
38 NEW_FOREGROUND_TAB,
39 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
40
41 TabContents* tab_contents = browser()->GetSelectedTabContents();
42 ASSERT_TRUE(tab_contents != NULL);
43
44 std::string result;
45 ASSERT_TRUE(
46 ui_test_utils::ExecuteJavaScriptAndExtractString(
47 tab_contents->render_view_host(),
48 L"",
49 L"window.domAutomationController.send("
50 L"'' + document.getElementsByTagName('td')[1].textContent);",
51 &result));
52 ASSERT_TRUE(result.find(kSharedWorkerJs) != std::string::npos);
53 }
54
55 } // namespace
56
OLDNEW
« 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