OLD | NEW |
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/html_dialog_ui.h" | 10 #include "chrome/browser/dom_ui/html_dialog_ui.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 size->set_height(40); | 51 size->set_height(40); |
52 } | 52 } |
53 virtual std::string GetDialogArgs() const { | 53 virtual std::string GetDialogArgs() const { |
54 return std::string(); | 54 return std::string(); |
55 } | 55 } |
56 virtual void OnDialogClosed(const std::string& json_retval) { } | 56 virtual void OnDialogClosed(const std::string& json_retval) { } |
57 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog) { | 57 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog) { |
58 if (out_close_dialog) | 58 if (out_close_dialog) |
59 *out_close_dialog = true; | 59 *out_close_dialog = true; |
60 } | 60 } |
| 61 virtual bool ShouldShowDialogTitle() const { return true; } |
61 }; | 62 }; |
62 | 63 |
63 } // namespace | 64 } // namespace |
64 | 65 |
65 class HtmlDialogBrowserTest : public InProcessBrowserTest { | 66 class HtmlDialogBrowserTest : public InProcessBrowserTest { |
66 public: | 67 public: |
67 HtmlDialogBrowserTest() {} | 68 HtmlDialogBrowserTest() {} |
68 | 69 |
69 #if defined(OS_WIN) | 70 #if defined(OS_WIN) |
70 class WindowChangedObserver : public base::MessagePumpForUI::Observer { | 71 class WindowChangedObserver : public base::MessagePumpForUI::Observer { |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 set_bounds.set_height(0); | 196 set_bounds.set_height(0); |
196 | 197 |
197 html_view->MoveContents(tab_contents, set_bounds); | 198 html_view->MoveContents(tab_contents, set_bounds); |
198 ui_test_utils::RunMessageLoop(); | 199 ui_test_utils::RunMessageLoop(); |
199 html_view->GetWidget()->GetBounds(&actual_bounds, false); | 200 html_view->GetWidget()->GetBounds(&actual_bounds, false); |
200 EXPECT_LT(0, actual_bounds.width()); | 201 EXPECT_LT(0, actual_bounds.width()); |
201 EXPECT_LT(0, actual_bounds.height()); | 202 EXPECT_LT(0, actual_bounds.height()); |
202 | 203 |
203 MessageLoopForUI::current()->RemoveObserver(WindowChangedObserver::Get()); | 204 MessageLoopForUI::current()->RemoveObserver(WindowChangedObserver::Get()); |
204 } | 205 } |
OLD | NEW |