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

Side by Side Diff: chrome/browser/ui/webui/workers_ui_browsertest.cc

Issue 9015022: Replace most of Browser::GetSelectedTabContents calls into Browser::GetSelectedWebContents. I've ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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 | « chrome/browser/ui/webui/web_ui_browsertest.cc ('k') | chrome/test/base/ui_test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 #include "chrome/common/url_constants.h" 6 #include "chrome/common/url_constants.h"
7 #include "chrome/test/base/in_process_browser_test.h" 7 #include "chrome/test/base/in_process_browser_test.h"
8 #include "chrome/test/base/ui_test_utils.h" 8 #include "chrome/test/base/ui_test_utils.h"
9 #include "content/browser/tab_contents/tab_contents.h"
10 #include "content/public/browser/navigation_details.h" 9 #include "content/public/browser/navigation_details.h"
10 #include "content/public/browser/web_contents.h"
11
12 using content::WebContents;
11 13
12 namespace { 14 namespace {
13 15
14 const char kSharedWorkerTestPage[] = 16 const char kSharedWorkerTestPage[] =
15 "files/workers/workers_ui_shared_worker.html"; 17 "files/workers/workers_ui_shared_worker.html";
16 const char kSharedWorkerJs[] = 18 const char kSharedWorkerJs[] =
17 "files/workers/workers_ui_shared_worker.js"; 19 "files/workers/workers_ui_shared_worker.js";
18 20
19 class WorkersUITest : public InProcessBrowserTest { 21 class WorkersUITest : public InProcessBrowserTest {
20 public: 22 public:
(...skipping 16 matching lines...) Expand all
37 ASSERT_TRUE(test_server()->Start()); 39 ASSERT_TRUE(test_server()->Start());
38 GURL url = test_server()->GetURL(kSharedWorkerTestPage); 40 GURL url = test_server()->GetURL(kSharedWorkerTestPage);
39 ui_test_utils::NavigateToURL(browser(), url); 41 ui_test_utils::NavigateToURL(browser(), url);
40 42
41 ui_test_utils::NavigateToURLWithDisposition( 43 ui_test_utils::NavigateToURLWithDisposition(
42 browser(), 44 browser(),
43 GURL(chrome::kChromeUIWorkersURL), 45 GURL(chrome::kChromeUIWorkersURL),
44 NEW_FOREGROUND_TAB, 46 NEW_FOREGROUND_TAB,
45 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); 47 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
46 48
47 TabContents* tab_contents = browser()->GetSelectedTabContents(); 49 WebContents* web_contents = browser()->GetSelectedWebContents();
48 ASSERT_TRUE(tab_contents != NULL); 50 ASSERT_TRUE(web_contents != NULL);
49 51
50 std::string result; 52 std::string result;
51 ASSERT_TRUE( 53 ASSERT_TRUE(
52 ui_test_utils::ExecuteJavaScriptAndExtractString( 54 ui_test_utils::ExecuteJavaScriptAndExtractString(
53 tab_contents->GetRenderViewHost(), 55 web_contents->GetRenderViewHost(),
54 L"", 56 L"",
55 L"window.domAutomationController.send(" 57 L"window.domAutomationController.send("
56 L"'' + document.getElementsByTagName('td')[1].textContent);", 58 L"'' + document.getElementsByTagName('td')[1].textContent);",
57 &result)); 59 &result));
58 ASSERT_TRUE(result.find(kSharedWorkerJs) != std::string::npos); 60 ASSERT_TRUE(result.find(kSharedWorkerJs) != std::string::npos);
59 } 61 }
60 62
61 } // namespace 63 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/web_ui_browsertest.cc ('k') | chrome/test/base/ui_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698