| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "remoting/host/it2me/it2me_confirmation_dialog_proxy.h" | 5 #include "remoting/host/it2me/it2me_confirmation_dialog_proxy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 It2MeConfirmationDialogProxyTest::~It2MeConfirmationDialogProxyTest() {} | 126 It2MeConfirmationDialogProxyTest::~It2MeConfirmationDialogProxyTest() {} |
| 127 | 127 |
| 128 TEST_F(It2MeConfirmationDialogProxyTest, Show) { | 128 TEST_F(It2MeConfirmationDialogProxyTest, Show) { |
| 129 ResultCallbackTarget callback_target(main_task_runner()); | 129 ResultCallbackTarget callback_target(main_task_runner()); |
| 130 | 130 |
| 131 EXPECT_CALL(*dialog(), OnShow()) | 131 EXPECT_CALL(*dialog(), OnShow()) |
| 132 .WillOnce( | 132 .WillOnce( |
| 133 InvokeWithoutArgs( | 133 InvokeWithoutArgs( |
| 134 CreateFunctor( | 134 CreateFunctor( |
| 135 dialog(), &StubIt2MeConfirmationDialog::ReportResult, | 135 &StubIt2MeConfirmationDialog::ReportResult, |
| 136 base::Unretained(dialog()), |
| 136 It2MeConfirmationDialog::Result::CANCEL))); | 137 It2MeConfirmationDialog::Result::CANCEL))); |
| 137 | 138 |
| 138 EXPECT_CALL(callback_target, | 139 EXPECT_CALL(callback_target, |
| 139 OnDialogResult(It2MeConfirmationDialog::Result::CANCEL)) | 140 OnDialogResult(It2MeConfirmationDialog::Result::CANCEL)) |
| 140 .WillOnce( | 141 .WillOnce( |
| 141 InvokeWithoutArgs(this, &It2MeConfirmationDialogProxyTest::Quit)); | 142 InvokeWithoutArgs(this, &It2MeConfirmationDialogProxyTest::Quit)); |
| 142 | 143 |
| 143 dialog_proxy()->Show(callback_target.MakeCallback()); | 144 dialog_proxy()->Show(callback_target.MakeCallback()); |
| 144 | 145 |
| 145 Run(); | 146 Run(); |
| 146 } | 147 } |
| 147 | 148 |
| 148 } // namespace remoting | 149 } // namespace remoting |
| OLD | NEW |