Commit 5bbcd21b authored by avi@chromium.org's avatar avi@chromium.org

TabContentsWrapper -> TabContents, part 9.

Content Settings.

BUG=131026
TEST=no change


Review URL: https://chromiumcodereview.appspot.com/10544056

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141219 0039d316-1c4b-4281-b951-d872f2087c98
parent 364a4389
......@@ -11,7 +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/tab_contents/tab_contents_wrapper.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"
#include "chrome/test/base/ui_test_utils.h"
......@@ -31,7 +31,7 @@ IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, RedirectLoopCookies) {
ui_test_utils::NavigateToURL(browser(), test_url);
TabContentsWrapper* tab_contents = browser()->GetSelectedTabContentsWrapper();
TabContents* tab_contents = browser()->GetActiveTabContents();
ASSERT_EQ(UTF8ToUTF16(test_url.spec() + " failed to load"),
tab_contents->web_contents()->GetTitle());
......@@ -47,7 +47,7 @@ IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, ContentSettingsBlockDataURLs) {
ui_test_utils::NavigateToURL(browser(), url);
TabContentsWrapper* tab_contents = browser()->GetSelectedTabContentsWrapper();
TabContents* tab_contents = browser()->GetActiveTabContents();
ASSERT_EQ(UTF8ToUTF16("Data URL"), tab_contents->web_contents()->GetTitle());
EXPECT_TRUE(tab_contents->content_settings()->IsContentBlocked(
......@@ -72,7 +72,7 @@ IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, RedirectCrossOrigin) {
ui_test_utils::NavigateToURL(browser(), test_url);
TabContentsWrapper* tab_contents = browser()->GetSelectedTabContentsWrapper();
TabContents* tab_contents = browser()->GetActiveTabContents();
EXPECT_TRUE(tab_contents->content_settings()->IsContentBlocked(
CONTENT_SETTINGS_TYPE_COOKIES));
......@@ -109,10 +109,10 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, Basic) {
string16 expected_title(ASCIIToUTF16("OK"));
ui_test_utils::TitleWatcher title_watcher(
browser()->GetSelectedWebContents(), expected_title);
browser()->GetActiveWebContents(), expected_title);
content::RenderViewHost* host =
browser()->GetSelectedWebContents()->GetRenderViewHost();
browser()->GetActiveWebContents()->GetRenderViewHost();
host->Send(new ChromeViewMsg_LoadBlockedPlugins(
host->GetRoutingID(), std::string()));
......@@ -130,20 +130,20 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, LoadAllBlockedPlugins) {
string16 expected_title1(ASCIIToUTF16("1"));
ui_test_utils::TitleWatcher title_watcher1(
browser()->GetSelectedWebContents(), expected_title1);
browser()->GetActiveWebContents(), expected_title1);
content::RenderViewHost* host =
browser()->GetSelectedWebContents()->GetRenderViewHost();
browser()->GetActiveWebContents()->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()->GetSelectedWebContents(), expected_title2);
browser()->GetActiveWebContents(), expected_title2);
ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(
browser()->GetSelectedWebContents()->GetRenderViewHost(),
browser()->GetActiveWebContents()->GetRenderViewHost(),
L"", L"window.inject()"));
EXPECT_EQ(expected_title2, title_watcher2.WaitAndGetTitle());
......@@ -159,15 +159,15 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, NoCallbackAtLoad) {
// Inject the callback function into the HTML page generated by the browser.
ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(
browser()->GetSelectedWebContents()->GetRenderViewHost(),
browser()->GetActiveWebContents()->GetRenderViewHost(),
L"", L"CallOnStartup = function() { document.title = \"OK\"; }"));
string16 expected_title(ASCIIToUTF16("OK"));
ui_test_utils::TitleWatcher title_watcher(
browser()->GetSelectedWebContents(), expected_title);
browser()->GetActiveWebContents(), expected_title);
content::RenderViewHost* host =
browser()->GetSelectedWebContents()->GetRenderViewHost();
browser()->GetActiveWebContents()->GetRenderViewHost();
host->Send(new ChromeViewMsg_LoadBlockedPlugins(
host->GetRoutingID(), std::string()));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment