| 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 #include "chrome/browser/printing/print_dialog_cloud.h" | 5 #include "chrome/browser/printing/print_dialog_cloud.h" |
| 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" | 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "chrome/browser/printing/cloud_print/cloud_print_url.h" | 18 #include "chrome/browser/printing/cloud_print/cloud_print_url.h" |
| 19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
| 20 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
| 21 #include "chrome/test/testing_profile.h" | 21 #include "chrome/test/testing_profile.h" |
| 22 #include "content/browser/browser_thread.h" | 22 #include "content/browser/browser_thread.h" |
| 23 #include "content/common/content_notification_types.h" |
| 23 #include "content/common/notification_details.h" | 24 #include "content/common/notification_details.h" |
| 24 #include "content/common/notification_source.h" | 25 #include "content/common/notification_source.h" |
| 25 #include "content/common/notification_type.h" | |
| 26 #include "testing/gmock/include/gmock/gmock.h" | 26 #include "testing/gmock/include/gmock/gmock.h" |
| 27 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
| 28 | 28 |
| 29 using testing::A; | 29 using testing::A; |
| 30 using testing::AtLeast; | 30 using testing::AtLeast; |
| 31 using testing::Eq; | 31 using testing::Eq; |
| 32 using testing::HasSubstr; | 32 using testing::HasSubstr; |
| 33 using testing::IsNull; | 33 using testing::IsNull; |
| 34 using testing::NotNull; | 34 using testing::NotNull; |
| 35 using testing::Return; | 35 using testing::Return; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 : public CloudPrintFlowHandler, | 81 : public CloudPrintFlowHandler, |
| 82 public base::SupportsWeakPtr<MockCloudPrintFlowHandler> { | 82 public base::SupportsWeakPtr<MockCloudPrintFlowHandler> { |
| 83 public: | 83 public: |
| 84 explicit MockCloudPrintFlowHandler(const FilePath& path, | 84 explicit MockCloudPrintFlowHandler(const FilePath& path, |
| 85 const string16& title, | 85 const string16& title, |
| 86 const std::string& file_type) | 86 const std::string& file_type) |
| 87 : CloudPrintFlowHandler(path, title, file_type) {} | 87 : CloudPrintFlowHandler(path, title, file_type) {} |
| 88 MOCK_METHOD0(DestructorCalled, void()); | 88 MOCK_METHOD0(DestructorCalled, void()); |
| 89 MOCK_METHOD0(RegisterMessages, void()); | 89 MOCK_METHOD0(RegisterMessages, void()); |
| 90 MOCK_METHOD3(Observe, | 90 MOCK_METHOD3(Observe, |
| 91 void(NotificationType type, | 91 void(int type, |
| 92 const NotificationSource& source, | 92 const NotificationSource& source, |
| 93 const NotificationDetails& details)); | 93 const NotificationDetails& details)); |
| 94 MOCK_METHOD1(SetDialogDelegate, | 94 MOCK_METHOD1(SetDialogDelegate, |
| 95 void(CloudPrintHtmlDialogDelegate* delegate)); | 95 void(CloudPrintHtmlDialogDelegate* delegate)); |
| 96 MOCK_METHOD0(CreateCloudPrintDataSender, | 96 MOCK_METHOD0(CreateCloudPrintDataSender, |
| 97 scoped_refptr<CloudPrintDataSender>()); | 97 scoped_refptr<CloudPrintDataSender>()); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 class MockCloudPrintHtmlDialogDelegate : public CloudPrintHtmlDialogDelegate { | 100 class MockCloudPrintHtmlDialogDelegate : public CloudPrintHtmlDialogDelegate { |
| 101 public: | 101 public: |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 delegate_->GetWebUIMessageHandlers(&handlers); | 338 delegate_->GetWebUIMessageHandlers(&handlers); |
| 339 delegate_.reset(); | 339 delegate_.reset(); |
| 340 EXPECT_THAT(mock_flow_handler_.get(), NotNull()); | 340 EXPECT_THAT(mock_flow_handler_.get(), NotNull()); |
| 341 } | 341 } |
| 342 | 342 |
| 343 // Testing for ExternalHtmlDialogUI needs a mock TabContents, mock | 343 // Testing for ExternalHtmlDialogUI needs a mock TabContents, mock |
| 344 // CloudPrintHtmlDialogDelegate (provided through the mock | 344 // CloudPrintHtmlDialogDelegate (provided through the mock |
| 345 // tab_contents) | 345 // tab_contents) |
| 346 | 346 |
| 347 // Testing for PrintDialogCloud needs a mock Browser. | 347 // Testing for PrintDialogCloud needs a mock Browser. |
| OLD | NEW |