| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 mock_file_type, false, base::Closure()); | 305 mock_file_type, false, base::Closure()); |
| 306 mock_flow_handler_ = handler->AsWeakPtr(); | 306 mock_flow_handler_ = handler->AsWeakPtr(); |
| 307 EXPECT_CALL(*mock_flow_handler_.get(), SetDialogDelegate(_)); | 307 EXPECT_CALL(*mock_flow_handler_.get(), SetDialogDelegate(_)); |
| 308 EXPECT_CALL(*mock_flow_handler_.get(), SetDialogDelegate(NULL)); | 308 EXPECT_CALL(*mock_flow_handler_.get(), SetDialogDelegate(NULL)); |
| 309 delegate_.reset(new CloudPrintWebDialogDelegate(mock_flow_handler_.get(), | 309 delegate_.reset(new CloudPrintWebDialogDelegate(mock_flow_handler_.get(), |
| 310 std::string())); | 310 std::string())); |
| 311 } | 311 } |
| 312 | 312 |
| 313 virtual void TearDown() { | 313 virtual void TearDown() { |
| 314 delegate_.reset(); | 314 delegate_.reset(); |
| 315 if (mock_flow_handler_) | 315 if (mock_flow_handler_.get()) |
| 316 delete mock_flow_handler_.get(); | 316 delete mock_flow_handler_.get(); |
| 317 } | 317 } |
| 318 | 318 |
| 319 base::MessageLoopForUI message_loop_; | 319 base::MessageLoopForUI message_loop_; |
| 320 content::TestBrowserThread ui_thread_; | 320 content::TestBrowserThread ui_thread_; |
| 321 base::WeakPtr<MockCloudPrintFlowHandler> mock_flow_handler_; | 321 base::WeakPtr<MockCloudPrintFlowHandler> mock_flow_handler_; |
| 322 scoped_ptr<CloudPrintWebDialogDelegate> delegate_; | 322 scoped_ptr<CloudPrintWebDialogDelegate> delegate_; |
| 323 }; | 323 }; |
| 324 | 324 |
| 325 TEST_F(CloudPrintWebDialogDelegateTest, BasicChecks) { | 325 TEST_F(CloudPrintWebDialogDelegateTest, BasicChecks) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 341 std::vector<WebUIMessageHandler*> handlers; | 341 std::vector<WebUIMessageHandler*> handlers; |
| 342 delegate_->GetWebUIMessageHandlers(&handlers); | 342 delegate_->GetWebUIMessageHandlers(&handlers); |
| 343 delegate_.reset(); | 343 delegate_.reset(); |
| 344 EXPECT_THAT(mock_flow_handler_.get(), NotNull()); | 344 EXPECT_THAT(mock_flow_handler_.get(), NotNull()); |
| 345 } | 345 } |
| 346 | 346 |
| 347 // Testing for ExternalWebDialogUI needs a mock WebContents and mock | 347 // Testing for ExternalWebDialogUI needs a mock WebContents and mock |
| 348 // CloudPrintWebDialogDelegate (attached to the mock web_contents). | 348 // CloudPrintWebDialogDelegate (attached to the mock web_contents). |
| 349 | 349 |
| 350 // Testing for PrintDialogCloud needs a mock Browser. | 350 // Testing for PrintDialogCloud needs a mock Browser. |
| OLD | NEW |