| Index: chrome/browser/browser_keyevents_browsertest.cc
|
| ===================================================================
|
| --- chrome/browser/browser_keyevents_browsertest.cc (revision 116244)
|
| +++ chrome/browser/browser_keyevents_browsertest.cc (working copy)
|
| @@ -18,10 +18,10 @@
|
| #include "chrome/test/base/ui_test_utils.h"
|
| #include "content/browser/renderer_host/render_view_host.h"
|
| #include "content/browser/renderer_host/render_widget_host_view.h"
|
| -#include "content/browser/tab_contents/tab_contents.h"
|
| #include "content/browser/tab_contents/tab_contents_view.h"
|
| #include "content/public/browser/notification_registrar.h"
|
| #include "content/public/browser/notification_service.h"
|
| +#include "content/public/browser/web_contents.h"
|
| #include "net/test/test_server.h"
|
| #include "ui/base/keycodes/keyboard_codes.h"
|
|
|
| @@ -143,7 +143,7 @@
|
| ASSERT_LT(tab_index, browser()->tab_count());
|
| bool actual;
|
| ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
|
| - browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(),
|
| + browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
|
| L"",
|
| base::StringPrintf(kSuppressEventJS, type, GetBoolString(!suppress)),
|
| &actual));
|
| @@ -169,7 +169,7 @@
|
| void GetResultLength(int tab_index, int* length) {
|
| ASSERT_LT(tab_index, browser()->tab_count());
|
| ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractInt(
|
| - browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(),
|
| + browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
|
| L"", kGetResultLengthJS, length));
|
| }
|
|
|
| @@ -181,7 +181,7 @@
|
| for (int i = 0; i < actual_length; ++i) {
|
| std::string actual;
|
| ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
|
| - browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(),
|
| + browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
|
| L"", base::StringPrintf(kGetResultJS, i), &actual));
|
|
|
| // If more events were received than expected, then the additional events
|
| @@ -197,7 +197,7 @@
|
| ASSERT_LT(tab_index, browser()->tab_count());
|
| std::string actual;
|
| ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
|
| - browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(),
|
| + browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
|
| L"", kGetFocusedElementJS, &actual));
|
| ASSERT_EQ(WideToUTF8(focused), actual);
|
| }
|
| @@ -206,7 +206,7 @@
|
| ASSERT_LT(tab_index, browser()->tab_count());
|
| bool actual;
|
| ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
|
| - browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(),
|
| + browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
|
| L"",
|
| base::StringPrintf(kSetFocusedElementJS, focused),
|
| &actual));
|
| @@ -218,7 +218,7 @@
|
| ASSERT_LT(tab_index, browser()->tab_count());
|
| std::string actual;
|
| ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
|
| - browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(),
|
| + browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
|
| L"",
|
| base::StringPrintf(kGetTextBoxValueJS, id),
|
| &actual));
|
| @@ -230,7 +230,7 @@
|
| ASSERT_LT(tab_index, browser()->tab_count());
|
| std::string actual;
|
| ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
|
| - browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(),
|
| + browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
|
| L"",
|
| base::StringPrintf(kSetTextBoxValueJS, id, value),
|
| &actual));
|
| @@ -241,7 +241,7 @@
|
| ASSERT_LT(tab_index, browser()->tab_count());
|
| bool actual;
|
| ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
|
| - browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(),
|
| + browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
|
| L"", base::StringPrintf(kStartTestJS, result_length), &actual));
|
| ASSERT_TRUE(actual);
|
| }
|
| @@ -261,7 +261,7 @@
|
| // because the test finished message might be arrived before returning
|
| // from the SendKeyPressSync() method.
|
| TestFinishObserver finish_observer(
|
| - browser()->GetTabContentsAt(tab_index)->GetRenderViewHost());
|
| + browser()->GetWebContentsAt(tab_index)->GetRenderViewHost());
|
|
|
| ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
|
| browser(), test.key, test.ctrl, test.shift, test.alt, test.command));
|
| @@ -713,7 +713,7 @@
|
| ui_test_utils::WindowedNotificationObserver wait_for_tab_closed(
|
| content::NOTIFICATION_TAB_CLOSED,
|
| content::Source<content::NavigationController>(
|
| - &browser()->GetTabContentsAt(1)->GetController()));
|
| + &browser()->GetWebContentsAt(1)->GetController()));
|
|
|
| // Press Ctrl/Cmd+W, which will close the tab.
|
| #if defined(OS_MACOSX)
|
|
|