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

Side by Side Diff: remoting/host/it2me/it2me_confirmation_dialog_proxy_unittest.cc

Issue 2310303002: Moving It2Me confirmation prompt into the Validation callback flow (Closed)
Patch Set: Fixing a DCHECK issue. Created 4 years, 3 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
OLDNEW
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 <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 void ReportResult(Result result) { 33 void ReportResult(Result result) {
34 ASSERT_TRUE(task_runner_->BelongsToCurrentThread()); 34 ASSERT_TRUE(task_runner_->BelongsToCurrentThread());
35 callback_.Run(result); 35 callback_.Run(result);
36 } 36 }
37 37
38 MOCK_METHOD0(OnShow, void()); 38 MOCK_METHOD0(OnShow, void());
39 39
40 // It2MeConfirmationDialog implementation. 40 // It2MeConfirmationDialog implementation.
41 void Show(const ResultCallback& callback) override { 41 void Show(const std::string& remote_user_email,
42 const ResultCallback& callback) override {
42 EXPECT_TRUE(callback_.is_null()); 43 EXPECT_TRUE(callback_.is_null());
43 EXPECT_TRUE(task_runner_->BelongsToCurrentThread()); 44 EXPECT_TRUE(task_runner_->BelongsToCurrentThread());
Sergey Ulanov 2016/09/09 18:46:57 verify that we get correct user email here.
joedow 2016/09/10 02:50:36 Done.
44 callback_ = callback; 45 callback_ = callback;
45 OnShow(); 46 OnShow();
46 } 47 }
47 48
48 private: 49 private:
49 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 50 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
50 ResultCallback callback_; 51 ResultCallback callback_;
51 }; 52 };
52 53
53 // Encapsulates a target for It2MeConfirmationDialog::ResultCallback. 54 // Encapsulates a target for It2MeConfirmationDialog::ResultCallback.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 CreateFunctor( 135 CreateFunctor(
135 &StubIt2MeConfirmationDialog::ReportResult, 136 &StubIt2MeConfirmationDialog::ReportResult,
136 base::Unretained(dialog()), 137 base::Unretained(dialog()),
137 It2MeConfirmationDialog::Result::CANCEL))); 138 It2MeConfirmationDialog::Result::CANCEL)));
138 139
139 EXPECT_CALL(callback_target, 140 EXPECT_CALL(callback_target,
140 OnDialogResult(It2MeConfirmationDialog::Result::CANCEL)) 141 OnDialogResult(It2MeConfirmationDialog::Result::CANCEL))
141 .WillOnce( 142 .WillOnce(
142 InvokeWithoutArgs(this, &It2MeConfirmationDialogProxyTest::Quit)); 143 InvokeWithoutArgs(this, &It2MeConfirmationDialogProxyTest::Quit));
143 144
144 dialog_proxy()->Show(callback_target.MakeCallback()); 145 dialog_proxy()->Show("faux_remote_user", callback_target.MakeCallback());
145 146
146 Run(); 147 Run();
147 } 148 }
148 149
149 } // namespace remoting 150 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698