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

Side by Side Diff: chrome/browser/external_extension_browsertest.cc

Issue 10702029: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | « chrome/browser/extensions/window_open_apitest.cc ('k') | chrome/browser/first_run/first_run.cc » ('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) 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/string_util.h" 6 #include "base/string_util.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_tabstrip.h"
9 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
10 #include "chrome/test/base/in_process_browser_test.h" 11 #include "chrome/test/base/in_process_browser_test.h"
11 #include "chrome/test/base/ui_test_utils.h" 12 #include "chrome/test/base/ui_test_utils.h"
12 #include "content/public/browser/web_contents.h" 13 #include "content/public/browser/web_contents.h"
13 #include "content/public/common/url_constants.h" 14 #include "content/public/common/url_constants.h"
14 #include "net/test/test_server.h" 15 #include "net/test/test_server.h"
15 16
16 namespace { 17 namespace {
17 18
18 struct IsSearchProviderTestData { 19 struct IsSearchProviderTestData {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 Browser* browser, 53 Browser* browser,
53 const char* host, 54 const char* host,
54 const char* expected_result) { 55 const char* expected_result) {
55 GURL test_url(std::string("http://") + host + 56 GURL test_url(std::string("http://") + host +
56 search_provider_test_url_.path() + "#" + expected_result); 57 search_provider_test_url_.path() + "#" + expected_result);
57 ui_test_utils::NavigateToURLWithDisposition( 58 ui_test_utils::NavigateToURLWithDisposition(
58 browser, test_url, NEW_FOREGROUND_TAB, 59 browser, test_url, NEW_FOREGROUND_TAB,
59 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); 60 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB);
60 61
61 // Bundle up information needed to verify the result. 62 // Bundle up information needed to verify the result.
62 content::WebContents* tab = browser->GetActiveWebContents(); 63 content::WebContents* tab = chrome::GetActiveWebContents(browser);
63 return IsSearchProviderTestData(tab, host, test_url); 64 return IsSearchProviderTestData(tab, host, test_url);
64 } 65 }
65 66
66 void FinishIsSearchProviderInstalledTest( 67 void FinishIsSearchProviderInstalledTest(
67 const IsSearchProviderTestData& data) { 68 const IsSearchProviderTestData& data) {
68 string16 title = data.tab->GetTitle(); 69 string16 title = data.tab->GetTitle();
69 if (title.empty()) { 70 if (title.empty()) {
70 ui_test_utils::TitleWatcher title_watcher(data.tab, ASCIIToUTF16("OK")); 71 ui_test_utils::TitleWatcher title_watcher(data.tab, ASCIIToUTF16("OK"));
71 title_watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); 72 title_watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL"));
72 title = title_watcher.WaitAndGetTitle(); 73 title = title_watcher.WaitAndGetTitle();
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 IN_PROC_BROWSER_TEST_F(SearchProviderTest, 128 IN_PROC_BROWSER_TEST_F(SearchProviderTest,
128 TestIsSearchProviderInstalledWithException) { 129 TestIsSearchProviderInstalledWithException) {
129 // Change the url for the test page to one that throws an exception when 130 // Change the url for the test page to one that throws an exception when
130 // toString is called on the argument given to isSearchProviderInstalled. 131 // toString is called on the argument given to isSearchProviderInstalled.
131 search_provider_test_url_ = test_server()->GetURL( 132 search_provider_test_url_ = test_server()->GetURL(
132 "files/is_search_provider_installed_with_exception.html"); 133 "files/is_search_provider_installed_with_exception.html");
133 134
134 FinishIsSearchProviderInstalledTest(StartIsSearchProviderInstalledTest( 135 FinishIsSearchProviderInstalledTest(StartIsSearchProviderInstalledTest(
135 browser(), "www.google.com", "")); 136 browser(), "www.google.com", ""));
136 } 137 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/window_open_apitest.cc ('k') | chrome/browser/first_run/first_run.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698