| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import "chrome/browser/ui/cocoa/html_dialog_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/html_dialog_window_controller.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #import <Cocoa/Cocoa.h> | 10 #import <Cocoa/Cocoa.h> |
| 11 | 11 |
| 12 #import "base/mac/scoped_nsautorelease_pool.h" | 12 #import "base/mac/scoped_nsautorelease_pool.h" |
| 13 #include "base/sys_string_conversions.h" | 13 #include "base/sys_string_conversions.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 16 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
| 17 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 17 #include "chrome/browser/ui/webui/html_dialog_ui.h" |
| 18 #include "chrome/test/base/browser_with_test_window_test.h" | 18 #include "chrome/test/base/browser_with_test_window_test.h" |
| 19 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
| 20 #include "content/browser/webui/web_ui.h" | 20 #include "content/browser/webui/web_ui.h" |
| 21 #include "content/public/browser/web_ui_message_handler.h" |
| 21 #include "googleurl/src/gurl.h" | 22 #include "googleurl/src/gurl.h" |
| 22 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| 24 #include "ui/gfx/size.h" | 25 #include "ui/gfx/size.h" |
| 25 | 26 |
| 26 using content::WebContents; | 27 using content::WebContents; |
| 28 using content::WebUIMessageHandler; |
| 27 | 29 |
| 28 namespace { | 30 namespace { |
| 29 | 31 |
| 30 class MockDelegate : public HtmlDialogUIDelegate { | 32 class MockDelegate : public HtmlDialogUIDelegate { |
| 31 public: | 33 public: |
| 32 MOCK_CONST_METHOD0(IsDialogModal, bool()); | 34 MOCK_CONST_METHOD0(IsDialogModal, bool()); |
| 33 MOCK_CONST_METHOD0(GetDialogTitle, string16()); | 35 MOCK_CONST_METHOD0(GetDialogTitle, string16()); |
| 34 MOCK_CONST_METHOD0(GetDialogContentURL, GURL()); | 36 MOCK_CONST_METHOD0(GetDialogContentURL, GURL()); |
| 35 MOCK_CONST_METHOD1(GetWebUIMessageHandlers, | 37 MOCK_CONST_METHOD1(GetWebUIMessageHandlers, |
| 36 void(std::vector<WebUIMessageHandler*>*)); | 38 void(std::vector<WebUIMessageHandler*>*)); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 HtmlDialogWindowController* html_dialog_window_controller = | 91 HtmlDialogWindowController* html_dialog_window_controller = |
| 90 [[HtmlDialogWindowController alloc] initWithDelegate:&delegate_ | 92 [[HtmlDialogWindowController alloc] initWithDelegate:&delegate_ |
| 91 profile:profile()]; | 93 profile:profile()]; |
| 92 | 94 |
| 93 [html_dialog_window_controller loadDialogContents]; | 95 [html_dialog_window_controller loadDialogContents]; |
| 94 [html_dialog_window_controller showWindow:nil]; | 96 [html_dialog_window_controller showWindow:nil]; |
| 95 [html_dialog_window_controller close]; | 97 [html_dialog_window_controller close]; |
| 96 } | 98 } |
| 97 | 99 |
| 98 } // namespace | 100 } // namespace |
| OLD | NEW |