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

Unified Diff: chrome/browser/local_discovery/privetv3_session_unittest.cc

Issue 468613003: API change to allow sticker authentication for devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/local_discovery/privetv3_session_unittest.cc
diff --git a/chrome/browser/local_discovery/privetv3_session_unittest.cc b/chrome/browser/local_discovery/privetv3_session_unittest.cc
index 6a2176042679afc2e7efd1734865c98955914615..fd117a4424cc658f410ee185c3e2b2a49f228dbb 100644
--- a/chrome/browser/local_discovery/privetv3_session_unittest.cc
+++ b/chrome/browser/local_discovery/privetv3_session_unittest.cc
@@ -21,9 +21,10 @@ using testing::_;
class MockDelegate : public PrivetV3Session::Delegate {
public:
- MOCK_METHOD1(OnSetupConfirmationNeeded, void(const std::string&));
- MOCK_METHOD0(OnSessionEstablished, void());
- MOCK_METHOD0(OnCannotEstablishSession, void());
+ MOCK_METHOD2(OnSetupConfirmationNeeded,
+ void(const std::string&,
+ extensions::api::gcd_private::ConfirmationType));
+ MOCK_METHOD1(OnSessionStatus, void(extensions::api::gcd_private::Status));
};
class PrivetV3SessionTest : public testing::Test {
@@ -37,12 +38,16 @@ class PrivetV3SessionTest : public testing::Test {
base::MessageLoop::current()->PostTask(FROM_HERE, quit_closure_);
}
+ void ConfirmCode(const std::string& code,
+ extensions::api::gcd_private::ConfirmationType type) {
+ session_.ConfirmCode(code);
+ }
+
protected:
virtual void SetUp() OVERRIDE {
quit_closure_ = run_loop_.QuitClosure();
- EXPECT_CALL(delegate_, OnSetupConfirmationNeeded(_)).Times(0);
- EXPECT_CALL(delegate_, OnSessionEstablished()).Times(0);
- EXPECT_CALL(delegate_, OnCannotEstablishSession()).Times(0);
+ EXPECT_CALL(delegate_, OnSetupConfirmationNeeded(_, _)).Times(0);
+ EXPECT_CALL(delegate_, OnSessionStatus(_)).Times(0);
}
StrictMock<MockDelegate> delegate_;
@@ -53,17 +58,19 @@ class PrivetV3SessionTest : public testing::Test {
};
TEST_F(PrivetV3SessionTest, NotConfirmed) {
- EXPECT_CALL(delegate_, OnSetupConfirmationNeeded(_)).Times(1).WillOnce(
+ EXPECT_CALL(delegate_, OnSetupConfirmationNeeded(_, _)).Times(1).WillOnce(
InvokeWithoutArgs(this, &PrivetV3SessionTest::QuitLoop));
session_.Start();
run_loop_.Run();
}
TEST_F(PrivetV3SessionTest, Confirmed) {
- EXPECT_CALL(delegate_, OnSessionEstablished()).Times(1).WillOnce(
- InvokeWithoutArgs(this, &PrivetV3SessionTest::QuitLoop));
- EXPECT_CALL(delegate_, OnSetupConfirmationNeeded(_)).Times(1).WillOnce(
- InvokeWithoutArgs(&session_, &PrivetV3Session::ConfirmCode));
+ EXPECT_CALL(delegate_,
+ OnSessionStatus(extensions::api::gcd_private::STATUS_SUCCESS))
+ .Times(1)
+ .WillOnce(InvokeWithoutArgs(this, &PrivetV3SessionTest::QuitLoop));
+ EXPECT_CALL(delegate_, OnSetupConfirmationNeeded(_, _)).Times(1).WillOnce(
+ Invoke(this, &PrivetV3SessionTest::ConfirmCode));
session_.Start();
run_loop_.Run();
}
« no previous file with comments | « chrome/browser/local_discovery/privetv3_session.cc ('k') | chrome/browser/local_discovery/privetv3_setup_flow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698