Index: chrome/browser/content_settings/content_settings_browsertest.cc |
=================================================================== |
--- chrome/browser/content_settings/content_settings_browsertest.cc (revision 145001) |
+++ chrome/browser/content_settings/content_settings_browsertest.cc (working copy) |
@@ -11,6 +11,7 @@ |
#include "chrome/browser/content_settings/tab_specific_content_settings.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ui/browser.h" |
+#include "chrome/browser/ui/browser_tabstrip.h" |
#include "chrome/browser/ui/tab_contents/tab_contents.h" |
#include "chrome/common/render_messages.h" |
#include "chrome/test/base/in_process_browser_test.h" |
@@ -31,7 +32,7 @@ |
ui_test_utils::NavigateToURL(browser(), test_url); |
- TabContents* tab_contents = browser()->GetActiveTabContents(); |
+ TabContents* tab_contents = chrome::GetActiveTabContents(browser()); |
ASSERT_EQ(UTF8ToUTF16(test_url.spec() + " failed to load"), |
tab_contents->web_contents()->GetTitle()); |
@@ -47,7 +48,7 @@ |
ui_test_utils::NavigateToURL(browser(), url); |
- TabContents* tab_contents = browser()->GetActiveTabContents(); |
+ TabContents* tab_contents = chrome::GetActiveTabContents(browser()); |
ASSERT_EQ(UTF8ToUTF16("Data URL"), tab_contents->web_contents()->GetTitle()); |
EXPECT_TRUE(tab_contents->content_settings()->IsContentBlocked( |
@@ -72,7 +73,7 @@ |
ui_test_utils::NavigateToURL(browser(), test_url); |
- TabContents* tab_contents = browser()->GetActiveTabContents(); |
+ TabContents* tab_contents = chrome::GetActiveTabContents(browser()); |
EXPECT_TRUE(tab_contents->content_settings()->IsContentBlocked( |
CONTENT_SETTINGS_TYPE_COOKIES)); |
@@ -109,10 +110,10 @@ |
string16 expected_title(ASCIIToUTF16("OK")); |
ui_test_utils::TitleWatcher title_watcher( |
- browser()->GetActiveWebContents(), expected_title); |
+ chrome::GetActiveWebContents(browser()), expected_title); |
content::RenderViewHost* host = |
- browser()->GetActiveWebContents()->GetRenderViewHost(); |
+ chrome::GetActiveWebContents(browser())->GetRenderViewHost(); |
host->Send(new ChromeViewMsg_LoadBlockedPlugins( |
host->GetRoutingID(), std::string())); |
@@ -130,20 +131,20 @@ |
string16 expected_title1(ASCIIToUTF16("1")); |
ui_test_utils::TitleWatcher title_watcher1( |
- browser()->GetActiveWebContents(), expected_title1); |
+ chrome::GetActiveWebContents(browser()), expected_title1); |
content::RenderViewHost* host = |
- browser()->GetActiveWebContents()->GetRenderViewHost(); |
+ chrome::GetActiveWebContents(browser())->GetRenderViewHost(); |
host->Send(new ChromeViewMsg_LoadBlockedPlugins( |
host->GetRoutingID(), std::string())); |
EXPECT_EQ(expected_title1, title_watcher1.WaitAndGetTitle()); |
string16 expected_title2(ASCIIToUTF16("2")); |
ui_test_utils::TitleWatcher title_watcher2( |
- browser()->GetActiveWebContents(), expected_title2); |
+ chrome::GetActiveWebContents(browser()), expected_title2); |
ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( |
- browser()->GetActiveWebContents()->GetRenderViewHost(), |
+ chrome::GetActiveWebContents(browser())->GetRenderViewHost(), |
L"", L"window.inject()")); |
EXPECT_EQ(expected_title2, title_watcher2.WaitAndGetTitle()); |
@@ -159,15 +160,15 @@ |
// Inject the callback function into the HTML page generated by the browser. |
ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( |
- browser()->GetActiveWebContents()->GetRenderViewHost(), |
+ chrome::GetActiveWebContents(browser())->GetRenderViewHost(), |
L"", L"CallOnStartup = function() { document.title = \"OK\"; }")); |
string16 expected_title(ASCIIToUTF16("OK")); |
ui_test_utils::TitleWatcher title_watcher( |
- browser()->GetActiveWebContents(), expected_title); |
+ chrome::GetActiveWebContents(browser()), expected_title); |
content::RenderViewHost* host = |
- browser()->GetActiveWebContents()->GetRenderViewHost(); |
+ chrome::GetActiveWebContents(browser())->GetRenderViewHost(); |
host->Send(new ChromeViewMsg_LoadBlockedPlugins( |
host->GetRoutingID(), std::string())); |