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

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

Issue 1553333002: Move cloud print specific files out of local_discovery (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moveprn
Patch Set: Created 4 years, 11 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/privet_confirm_api_flow_unittest.cc
diff --git a/chrome/browser/local_discovery/privet_confirm_api_flow_unittest.cc b/chrome/browser/local_discovery/privet_confirm_api_flow_unittest.cc
deleted file mode 100644
index 40f766ce1486b5c64e23fc8e1515f352bc679a0d..0000000000000000000000000000000000000000
--- a/chrome/browser/local_discovery/privet_confirm_api_flow_unittest.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/local_discovery/privet_confirm_api_flow.h"
-
-#include <set>
-
-#include "base/json/json_reader.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using testing::StrictMock;
-using testing::_;
-
-namespace local_discovery {
-
-namespace {
-
-const char kSampleConfirmResponse[] = "{"
- " \"success\": true"
- "}";
-
-const char kFailedConfirmResponse[] = "{"
- " \"success\": false"
- "}";
-
-TEST(PrivetConfirmApiFlowTest, Params) {
- PrivetConfirmApiCallFlow confirmation(
- "123", PrivetConfirmApiCallFlow::ResponseCallback());
- EXPECT_EQ(GURL("https://www.google.com/cloudprint/confirm?token=123"),
- confirmation.GetURL());
- EXPECT_EQ("https://www.googleapis.com/auth/cloudprint",
- confirmation.GetOAuthScope());
- EXPECT_EQ(net::URLFetcher::GET, confirmation.GetRequestType());
- EXPECT_FALSE(confirmation.GetExtraRequestHeaders().empty());
-}
-
-class MockDelegate {
- public:
- MOCK_METHOD1(Callback, void(GCDApiFlow::Status));
-};
-
-TEST(PrivetConfirmApiFlowTest, Parsing) {
- StrictMock<MockDelegate> delegate;
- PrivetConfirmApiCallFlow confirmation(
- "123", base::Bind(&MockDelegate::Callback, base::Unretained(&delegate)));
- EXPECT_CALL(delegate, Callback(GCDApiFlow::SUCCESS)).Times(1);
-
- scoped_ptr<base::Value> value =
- base::JSONReader::Read(kSampleConfirmResponse);
- const base::DictionaryValue* dictionary = NULL;
- ASSERT_TRUE(value->GetAsDictionary(&dictionary));
- confirmation.OnGCDAPIFlowComplete(*dictionary);
-
- EXPECT_CALL(delegate, Callback(GCDApiFlow::ERROR_FROM_SERVER)).Times(1);
-
- value = base::JSONReader::Read(kFailedConfirmResponse);
- ASSERT_TRUE(value->GetAsDictionary(&dictionary));
- confirmation.OnGCDAPIFlowComplete(*dictionary);
-}
-
-} // namespace
-
-} // namespace local_discovery
« no previous file with comments | « chrome/browser/local_discovery/privet_confirm_api_flow.cc ('k') | chrome/browser/local_discovery/privet_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698