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

Side by Side Diff: chrome/browser/extensions/docs/examples/apps/calculator_browsertest.cc

Issue 12066003: Remove TabStripModel wrapper use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gtk Created 7 years, 10 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/file_path.h" 5 #include "base/file_path.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "chrome/browser/ui/browser_tabstrip.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
8 #include "chrome/common/chrome_paths.h" 9 #include "chrome/common/chrome_paths.h"
9 #include "chrome/test/base/in_process_browser_test.h" 10 #include "chrome/test/base/in_process_browser_test.h"
10 #include "chrome/test/base/ui_test_utils.h" 11 #include "chrome/test/base/ui_test_utils.h"
11 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
12 #include "content/public/test/browser_test_utils.h" 13 #include "content/public/test/browser_test_utils.h"
13 #include "net/base/net_util.h" 14 #include "net/base/net_util.h"
14 15
15 class CalculatorBrowserTest : public InProcessBrowserTest { 16 class CalculatorBrowserTest : public InProcessBrowserTest {
16 }; 17 };
17 18
18 IN_PROC_BROWSER_TEST_F(CalculatorBrowserTest, Model) { 19 IN_PROC_BROWSER_TEST_F(CalculatorBrowserTest, Model) {
19 FilePath test_file; 20 FilePath test_file;
20 PathService::Get(chrome::DIR_TEST_DATA, &test_file); 21 PathService::Get(chrome::DIR_TEST_DATA, &test_file);
21 test_file = test_file.DirName().DirName() 22 test_file = test_file.DirName().DirName()
22 .AppendASCII("common").AppendASCII("extensions").AppendASCII("docs") 23 .AppendASCII("common").AppendASCII("extensions").AppendASCII("docs")
23 .AppendASCII("examples").AppendASCII("apps").AppendASCII("calculator") 24 .AppendASCII("examples").AppendASCII("apps").AppendASCII("calculator")
24 .AppendASCII("tests").AppendASCII("automatic.html"); 25 .AppendASCII("tests").AppendASCII("automatic.html");
25 26
26 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(test_file)); 27 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(test_file));
27 28
28 bool success; 29 bool success;
29 bool executed = content::ExecuteScriptAndExtractBool( 30 bool executed = content::ExecuteScriptAndExtractBool(
30 chrome::GetActiveWebContents(browser()), 31 browser()->tab_strip_model()->GetActiveWebContents(),
31 "window.domAutomationController.send(window.runTests().success)", 32 "window.domAutomationController.send(window.runTests().success)",
32 &success); 33 &success);
33 34
34 ASSERT_TRUE(executed); 35 ASSERT_TRUE(executed);
35 ASSERT_TRUE(success); 36 ASSERT_TRUE(success);
36 } 37 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/content_script_apitest.cc ('k') | chrome/browser/extensions/extension_crash_recovery_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698