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

Side by Side Diff: chrome/browser/local_discovery/privet_confirm_api_flow_unittest.cc

Issue 409163005: Rename the CloudPrintPrinterListTest.Parsing test to PrivetConfirmApiFlowTest.Params to match the o… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/local_discovery/privet_confirm_api_flow.h" 5 #include "chrome/browser/local_discovery/privet_confirm_api_flow.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 23 matching lines...) Expand all
34 confirmation.GetOAuthScope()); 34 confirmation.GetOAuthScope());
35 EXPECT_EQ(net::URLFetcher::GET, confirmation.GetRequestType()); 35 EXPECT_EQ(net::URLFetcher::GET, confirmation.GetRequestType());
36 EXPECT_FALSE(confirmation.GetExtraRequestHeaders().empty()); 36 EXPECT_FALSE(confirmation.GetExtraRequestHeaders().empty());
37 } 37 }
38 38
39 class MockDelegate { 39 class MockDelegate {
40 public: 40 public:
41 MOCK_METHOD1(Callback, void(GCDApiFlow::Status)); 41 MOCK_METHOD1(Callback, void(GCDApiFlow::Status));
42 }; 42 };
43 43
44 TEST(CloudPrintPrinterListTest, Parsing) { 44 TEST(PrivetConfirmApiFlowTest, Parsing) {
45 StrictMock<MockDelegate> delegate; 45 StrictMock<MockDelegate> delegate;
46 PrivetConfirmApiCallFlow confirmation( 46 PrivetConfirmApiCallFlow confirmation(
47 "123", base::Bind(&MockDelegate::Callback, base::Unretained(&delegate))); 47 "123", base::Bind(&MockDelegate::Callback, base::Unretained(&delegate)));
48 EXPECT_CALL(delegate, Callback(GCDApiFlow::SUCCESS)).Times(1); 48 EXPECT_CALL(delegate, Callback(GCDApiFlow::SUCCESS)).Times(1);
49 49
50 scoped_ptr<base::Value> value(base::JSONReader::Read(kSampleConfirmResponse)); 50 scoped_ptr<base::Value> value(base::JSONReader::Read(kSampleConfirmResponse));
51 const base::DictionaryValue* dictionary = NULL; 51 const base::DictionaryValue* dictionary = NULL;
52 ASSERT_TRUE(value->GetAsDictionary(&dictionary)); 52 ASSERT_TRUE(value->GetAsDictionary(&dictionary));
53 confirmation.OnGCDAPIFlowComplete(*dictionary); 53 confirmation.OnGCDAPIFlowComplete(*dictionary);
54 54
55 EXPECT_CALL(delegate, Callback(GCDApiFlow::ERROR_FROM_SERVER)).Times(1); 55 EXPECT_CALL(delegate, Callback(GCDApiFlow::ERROR_FROM_SERVER)).Times(1);
56 56
57 value.reset(base::JSONReader::Read(kFailedConfirmResponse)); 57 value.reset(base::JSONReader::Read(kFailedConfirmResponse));
58 ASSERT_TRUE(value->GetAsDictionary(&dictionary)); 58 ASSERT_TRUE(value->GetAsDictionary(&dictionary));
59 confirmation.OnGCDAPIFlowComplete(*dictionary); 59 confirmation.OnGCDAPIFlowComplete(*dictionary);
60 } 60 }
61 61
62 } // namespace 62 } // namespace
63 63
64 } // namespace local_discovery 64 } // namespace local_discovery
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698