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

Unified Diff: chrome/browser/browser_focus_uitest.cc

Issue 8817007: Revert 113015 - speculative revert to see if this fixes the interactive test breakage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 | « no previous file | chrome/test/base/ui_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_focus_uitest.cc
===================================================================
--- chrome/browser/browser_focus_uitest.cc (revision 113109)
+++ chrome/browser/browser_focus_uitest.cc (working copy)
@@ -26,6 +26,7 @@
#include "content/browser/tab_contents/interstitial_page.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_view.h"
+#include "content/common/view_messages.h"
#include "content/public/browser/notification_service.h"
#include "net/test/test_server.h"
@@ -63,9 +64,9 @@
#define MAYBE_TabsRememberFocusFindInPage FAILS_TabsRememberFocusFindInPage
#elif defined(OS_WIN)
// Disabled, http://crbug.com/62543.
-#define MAYBE_FocusTraversal FocusTraversal
+#define MAYBE_FocusTraversal DISABLED_FocusTraversal
// Disabled, http://crbug.com/62544.
-#define MAYBE_FocusTraversalOnInterstitial FocusTraversalOnInterstitial
+#define MAYBE_FocusTraversalOnInterstitial DISABLED_FocusTraversalOnInterstitial
// Flaky, http://crbug.com/62537.
#define MAYBE_TabsRememberFocusFindInPage FLAKY_TabsRememberFocusFindInPage
#endif
@@ -172,6 +173,23 @@
return render_view_host()->view()->HasFocus();
}
+ protected:
+ bool OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(TestInterstitialPage, message)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
+ }
+
+ void OnFocusedNodeChanged(bool is_editable_node) {
+ content::NotificationService::current()->Notify(
+ content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
+ content::Source<TabContents>(tab()),
+ content::Details<const bool>(&is_editable_node));
+ }
+
private:
std::string html_contents_;
};
@@ -493,8 +511,8 @@
ASSERT_TRUE(ui_test_utils::SendKeyPressAndWaitWithDetails(
browser(), ui::VKEY_TAB, false, false, false, false,
content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
- content::NotificationSource(content::Source<RenderViewHost>(
- browser()->GetSelectedTabContents()->render_view_host())),
+ content::NotificationSource(content::Source<TabContents>(
+ browser()->GetSelectedTabContents())),
details));
} else {
// On the last tab key press, the focus returns to the browser.
@@ -536,8 +554,8 @@
ASSERT_TRUE(ui_test_utils::SendKeyPressAndWaitWithDetails(
browser(), ui::VKEY_TAB, false, true, false, false,
content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
- content::NotificationSource(content::Source<RenderViewHost>(
- browser()->GetSelectedTabContents()->render_view_host())),
+ content::NotificationSource(content::Source<TabContents>(
+ browser()->GetSelectedTabContents())),
details));
} else {
// On the last tab key press, the focus returns to the browser.
@@ -620,8 +638,8 @@
content::NotificationService::AllSources();
if (j < arraysize(kExpElementIDs) - 1) {
notification_type = content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE;
- notification_source = content::Source<RenderViewHost>(
- interstitial_page->render_view_host());
+ notification_source = content::Source<TabContents>(
+ interstitial_page->tab());
} else {
// On the last tab key press, the focus returns to the browser.
notification_type = chrome::NOTIFICATION_FOCUS_RETURNED_TO_BROWSER;
@@ -655,8 +673,8 @@
content::NotificationService::AllSources();
if (j < arraysize(kExpElementIDs) - 1) {
notification_type = content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE;
- notification_source = content::Source<RenderViewHost>(
- interstitial_page->render_view_host());
+ notification_source = content::Source<TabContents>(
+ interstitial_page->tab());
} else {
// On the last tab key press, the focus returns to the browser.
notification_type = chrome::NOTIFICATION_FOCUS_RETURNED_TO_BROWSER;
« no previous file with comments | « no previous file | chrome/test/base/ui_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698