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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc

Issue 97993006: [rAC, OSX] Force better initial size for sign-in (2nd try) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/browser/ui/autofill/autofill_dialog_sign_in_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
index 882b653322d2ce8ab95e8e5be19cb0282515d6a6..0001dc5d2d16a5d4fafbcb01d9df7cf95ffd7450 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
@@ -57,6 +57,12 @@
#include "ui/base/window_open_disposition.h"
#include "url/gurl.h"
+#if defined(OS_MACOSX)
+#include "base/mac/mac_util.h"
+#include "base/mac/scoped_nsautorelease_pool.h"
+#include "chrome/browser/ui/cocoa/run_loop_testing.h"
+#endif
+
namespace autofill {
namespace {
@@ -282,6 +288,16 @@ class AutofillDialogControllerTest : public InProcessBrowserTest {
InitializeController();
}
+ // A helper function that cycles the MessageLoop, and on Mac, the Cocoa run
+ // loop. It also drains the NSAutoreleasePool.
+ void CycleRunLoops() {
+ content::RunAllPendingInMessageLoop();
+#if defined(OS_MACOSX)
+ chrome::testing::NSRunLoopRunAllPending();
+ AutoreleasePool()->Recycle();
+#endif
+ }
+
void InitializeController() {
FormData form;
form.name = ASCIIToUTF16("TestForm");
@@ -306,6 +322,7 @@ class AutofillDialogControllerTest : public InProcessBrowserTest {
metric_logger_,
message_loop_runner_);
controller_->Show();
+ CycleRunLoops(); // Ensures dialog is fully visible.
}
content::WebContents* GetActiveWebContents() {
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_sign_in_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698