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

Side by Side Diff: chrome/browser/dom_ui/constrained_html_ui_browsertest.cc

Issue 4110010: Cloud Print Dialog work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Direct paths for prefs. Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/ui/ui_test.h" 5 #include "chrome/test/ui/ui_test.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chrome/browser/browser_thread.h" 9 #include "chrome/browser/browser_thread.h"
10 #include "chrome/browser/dom_ui/constrained_html_ui.h" 10 #include "chrome/browser/dom_ui/constrained_html_ui.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 size->set_height(400); 43 size->set_height(400);
44 } 44 }
45 virtual std::string GetDialogArgs() const { 45 virtual std::string GetDialogArgs() const {
46 return std::string(); 46 return std::string();
47 } 47 }
48 virtual void OnDialogClosed(const std::string& json_retval) { } 48 virtual void OnDialogClosed(const std::string& json_retval) { }
49 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog) { 49 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog) {
50 if (out_close_dialog) 50 if (out_close_dialog)
51 *out_close_dialog = true; 51 *out_close_dialog = true;
52 } 52 }
53 virtual bool ShouldShowDialogTitle() const { return true; }
53 }; 54 };
54 55
55 } // namespace 56 } // namespace
56 57
57 class ConstrainedHtmlDialogBrowserTest : public InProcessBrowserTest { 58 class ConstrainedHtmlDialogBrowserTest : public InProcessBrowserTest {
58 public: 59 public:
59 ConstrainedHtmlDialogBrowserTest() {} 60 ConstrainedHtmlDialogBrowserTest() {}
60 }; 61 };
61 62
62 // Tests that opening/closing the constrained window won't crash it. 63 // Tests that opening/closing the constrained window won't crash it.
63 IN_PROC_BROWSER_TEST_F(ConstrainedHtmlDialogBrowserTest, BasicTest) { 64 IN_PROC_BROWSER_TEST_F(ConstrainedHtmlDialogBrowserTest, BasicTest) {
64 // The delegate deletes itself. 65 // The delegate deletes itself.
65 HtmlDialogUIDelegate* delegate = new TestHtmlDialogUIDelegate(); 66 HtmlDialogUIDelegate* delegate = new TestHtmlDialogUIDelegate();
66 TabContents* tab_contents = browser()->GetSelectedTabContents(); 67 TabContents* tab_contents = browser()->GetSelectedTabContents();
67 ASSERT_TRUE(tab_contents != NULL); 68 ASSERT_TRUE(tab_contents != NULL);
68 69
69 ConstrainedHtmlUI::CreateConstrainedHtmlDialog(browser()->profile(), 70 ConstrainedHtmlUI::CreateConstrainedHtmlDialog(browser()->profile(),
70 delegate, 71 delegate,
71 tab_contents); 72 tab_contents);
72 73
73 ASSERT_EQ(1U, tab_contents->constrained_window_count()); 74 ASSERT_EQ(1U, tab_contents->constrained_window_count());
74 } 75 }
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/html_dialog_window_controller_unittest.mm ('k') | chrome/browser/dom_ui/html_dialog_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698