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

Unified Diff: chrome/browser/ui/views/html_dialog_view_browsertest.cc

Issue 7024032: Wait showing html dialog until renderer finish painting after page is loaded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix clang error Created 9 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/ui/views/html_dialog_view.cc ('k') | chrome/browser/ui/views/keyboard_overlay_dialog_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/html_dialog_view_browsertest.cc
diff --git a/chrome/browser/ui/views/html_dialog_view_browsertest.cc b/chrome/browser/ui/views/html_dialog_view_browsertest.cc
index 8ec8681a52b78b7e4ca787da8c916d7b8d07d1d7..4483c4e0b0b495937554a9b176f662eb5274b8c9 100644
--- a/chrome/browser/ui/views/html_dialog_view_browsertest.cc
+++ b/chrome/browser/ui/views/html_dialog_view_browsertest.cc
@@ -42,7 +42,7 @@ class TestHtmlDialogUIDelegate : public HtmlDialogUIDelegate {
return std::wstring(L"Test");
}
virtual GURL GetDialogContentURL() const {
- return GURL(chrome::kAboutBlankURL);
+ return GURL(chrome::kAboutAboutURL);
}
virtual void GetWebUIMessageHandlers(
std::vector<WebUIMessageHandler*>* handlers) const { }
@@ -205,3 +205,30 @@ IN_PROC_BROWSER_TEST_F(HtmlDialogBrowserTest, MAYBE_SizeWindow) {
MessageLoopForUI::current()->RemoveObserver(
WindowChangedObserver::GetInstance());
}
+
+IN_PROC_BROWSER_TEST_F(HtmlDialogBrowserTest, TestStateTransition) {
+ HtmlDialogUIDelegate* delegate = new TestHtmlDialogUIDelegate();
+
+ HtmlDialogView* html_view =
+ new HtmlDialogView(browser()->profile(), delegate);
+ TabContents* tab_contents = browser()->GetSelectedTabContents();
+ ASSERT_TRUE(tab_contents != NULL);
+ views::Window::CreateChromeWindow(tab_contents->GetDialogRootWindow(),
+ gfx::Rect(), html_view);
+ // Test if the state transitions from INITIALIZED to -> PAINTED
+ EXPECT_EQ(HtmlDialogView::INITIALIZED, html_view->state_);
+
+ html_view->InitDialog();
+ html_view->window()->Show();
+
+ MessageLoopForUI::current()->AddObserver(
+ WindowChangedObserver::GetInstance());
+ // We use busy loop because the state is updated in notifications.
+ while (html_view->state_ != HtmlDialogView::PAINTED)
+ MessageLoop::current()->RunAllPending();
+
+ EXPECT_EQ(HtmlDialogView::PAINTED, html_view->state_);
+
+ MessageLoopForUI::current()->RemoveObserver(
+ WindowChangedObserver::GetInstance());
+}
« no previous file with comments | « chrome/browser/ui/views/html_dialog_view.cc ('k') | chrome/browser/ui/views/keyboard_overlay_dialog_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698