Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Side by Side Diff: chrome/browser/printing/print_dialog_cloud_unittest.cc

Issue 15987009: Update chrome/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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.
OLDNEW
« no previous file with comments | « chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc ('k') | chrome/browser/printing/print_system_task_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698