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/base/testing_browser_process_test.h" | |
22 #include "chrome/test/base/testing_profile.h" | 21 #include "chrome/test/base/testing_profile.h" |
23 #include "content/browser/browser_thread.h" | 22 #include "content/browser/browser_thread.h" |
24 #include "content/common/content_notification_types.h" | 23 #include "content/common/content_notification_types.h" |
25 #include "content/common/notification_details.h" | 24 #include "content/common/notification_details.h" |
26 #include "content/common/notification_source.h" | 25 #include "content/common/notification_source.h" |
27 #include "testing/gmock/include/gmock/gmock.h" | 26 #include "testing/gmock/include/gmock/gmock.h" |
28 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
29 | 28 |
30 using testing::A; | 29 using testing::A; |
31 using testing::AtLeast; | 30 using testing::AtLeast; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // of expects/results. | 139 // of expects/results. |
141 MockCloudPrintDataSenderHelper() : CloudPrintDataSenderHelper(NULL) {} | 140 MockCloudPrintDataSenderHelper() : CloudPrintDataSenderHelper(NULL) {} |
142 MOCK_METHOD1(CallJavascriptFunction, void(const std::wstring&)); | 141 MOCK_METHOD1(CallJavascriptFunction, void(const std::wstring&)); |
143 MOCK_METHOD2(CallJavascriptFunction, void(const std::wstring&, | 142 MOCK_METHOD2(CallJavascriptFunction, void(const std::wstring&, |
144 const Value& arg1)); | 143 const Value& arg1)); |
145 MOCK_METHOD3(CallJavascriptFunction, void(const std::wstring&, | 144 MOCK_METHOD3(CallJavascriptFunction, void(const std::wstring&, |
146 const Value& arg1, | 145 const Value& arg1, |
147 const Value& arg2)); | 146 const Value& arg2)); |
148 }; | 147 }; |
149 | 148 |
150 class CloudPrintURLTest : public TestingBrowserProcessTest { | 149 class CloudPrintURLTest : public testing::Test { |
151 public: | 150 public: |
152 CloudPrintURLTest() {} | 151 CloudPrintURLTest() {} |
153 | 152 |
154 protected: | 153 protected: |
155 virtual void SetUp() { | 154 virtual void SetUp() { |
156 profile_.reset(new TestingProfile()); | 155 profile_.reset(new TestingProfile()); |
157 } | 156 } |
158 | 157 |
159 scoped_ptr<Profile> profile_; | 158 scoped_ptr<Profile> profile_; |
160 }; | 159 }; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 delegate_->GetWebUIMessageHandlers(&handlers); | 346 delegate_->GetWebUIMessageHandlers(&handlers); |
348 delegate_.reset(); | 347 delegate_.reset(); |
349 EXPECT_THAT(mock_flow_handler_.get(), NotNull()); | 348 EXPECT_THAT(mock_flow_handler_.get(), NotNull()); |
350 } | 349 } |
351 | 350 |
352 // Testing for ExternalHtmlDialogUI needs a mock TabContents, mock | 351 // Testing for ExternalHtmlDialogUI needs a mock TabContents, mock |
353 // CloudPrintHtmlDialogDelegate (provided through the mock | 352 // CloudPrintHtmlDialogDelegate (provided through the mock |
354 // tab_contents) | 353 // tab_contents) |
355 | 354 |
356 // Testing for PrintDialogCloud needs a mock Browser. | 355 // Testing for PrintDialogCloud needs a mock Browser. |
OLD | NEW |