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

Unified Diff: chrome/browser/browser_keyevents_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, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_focus_uitest.cc ('k') | chrome/browser/captive_portal/captive_portal_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_keyevents_browsertest.cc
===================================================================
--- chrome/browser/browser_keyevents_browsertest.cc (revision 145001)
+++ chrome/browser/browser_keyevents_browsertest.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/in_process_browser_test.h"
@@ -146,7 +147,7 @@
ASSERT_LT(tab_index, browser()->tab_count());
bool actual;
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
- browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
+ chrome::GetWebContentsAt(browser(), tab_index)->GetRenderViewHost(),
L"",
base::StringPrintf(kSuppressEventJS, type, GetBoolString(!suppress)),
&actual));
@@ -172,7 +173,7 @@
void GetResultLength(int tab_index, int* length) {
ASSERT_LT(tab_index, browser()->tab_count());
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractInt(
- browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
+ chrome::GetWebContentsAt(browser(), tab_index)->GetRenderViewHost(),
L"", kGetResultLengthJS, length));
}
@@ -184,7 +185,7 @@
for (int i = 0; i < actual_length; ++i) {
std::string actual;
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
- browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
+ chrome::GetWebContentsAt(browser(), tab_index)->GetRenderViewHost(),
L"", base::StringPrintf(kGetResultJS, i), &actual));
// If more events were received than expected, then the additional events
@@ -200,7 +201,7 @@
ASSERT_LT(tab_index, browser()->tab_count());
std::string actual;
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
- browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
+ chrome::GetWebContentsAt(browser(), tab_index)->GetRenderViewHost(),
L"", kGetFocusedElementJS, &actual));
ASSERT_EQ(WideToUTF8(focused), actual);
}
@@ -209,7 +210,7 @@
ASSERT_LT(tab_index, browser()->tab_count());
bool actual;
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
- browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
+ chrome::GetWebContentsAt(browser(), tab_index)->GetRenderViewHost(),
L"",
base::StringPrintf(kSetFocusedElementJS, focused),
&actual));
@@ -221,7 +222,7 @@
ASSERT_LT(tab_index, browser()->tab_count());
std::string actual;
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
- browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
+ chrome::GetWebContentsAt(browser(), tab_index)->GetRenderViewHost(),
L"",
base::StringPrintf(kGetTextBoxValueJS, id),
&actual));
@@ -233,7 +234,7 @@
ASSERT_LT(tab_index, browser()->tab_count());
std::string actual;
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
- browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
+ chrome::GetWebContentsAt(browser(), tab_index)->GetRenderViewHost(),
L"",
base::StringPrintf(kSetTextBoxValueJS, id, value),
&actual));
@@ -244,7 +245,7 @@
ASSERT_LT(tab_index, browser()->tab_count());
bool actual;
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
- browser()->GetWebContentsAt(tab_index)->GetRenderViewHost(),
+ chrome::GetWebContentsAt(browser(), tab_index)->GetRenderViewHost(),
L"", base::StringPrintf(kStartTestJS, result_length), &actual));
ASSERT_TRUE(actual);
}
@@ -264,7 +265,7 @@
// because the test finished message might be arrived before returning
// from the SendKeyPressSync() method.
TestFinishObserver finish_observer(
- browser()->GetWebContentsAt(tab_index)->GetRenderViewHost());
+ chrome::GetWebContentsAt(browser(), tab_index)->GetRenderViewHost());
ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
browser(), test.key, test.ctrl, test.shift, test.alt, test.command));
@@ -737,7 +738,7 @@
ui_test_utils::WindowedNotificationObserver wait_for_tab_closed(
content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
- content::Source<content::WebContents>(browser()->GetWebContentsAt(1)));
+ content::Source<content::WebContents>(chrome::GetWebContentsAt(browser(), 1)));
// Press Ctrl/Cmd+W, which will close the tab.
#if defined(OS_MACOSX)
« no previous file with comments | « chrome/browser/browser_focus_uitest.cc ('k') | chrome/browser/captive_portal/captive_portal_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698