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

Side by Side Diff: chrome/browser/extensions/api/gcd_private/gcd_private_apitest.cc

Issue 1450213002: Enable PrivetV3Session without checking command line flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@context7
Patch Set: Created 5 years, 1 month 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/extensions/api/gcd_private/gcd_private_api.h" 6 #include "chrome/browser/extensions/api/gcd_private/gcd_private_api.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/local_discovery/test_service_discovery_client.h" 8 #include "chrome/browser/local_discovery/test_service_discovery_client.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "extensions/common/switches.h" 10 #include "extensions/common/switches.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 : url_fetcher_factory_( 80 : url_fetcher_factory_(
81 &url_fetcher_impl_factory_, 81 &url_fetcher_impl_factory_,
82 base::Bind(&GcdPrivateAPITest::CreateFakeURLFetcher, 82 base::Bind(&GcdPrivateAPITest::CreateFakeURLFetcher,
83 base::Unretained(this))) {} 83 base::Unretained(this))) {}
84 84
85 void SetUpCommandLine(base::CommandLine* command_line) override { 85 void SetUpCommandLine(base::CommandLine* command_line) override {
86 ExtensionApiTest::SetUpCommandLine(command_line); 86 ExtensionApiTest::SetUpCommandLine(command_line);
87 command_line->AppendSwitchASCII( 87 command_line->AppendSwitchASCII(
88 extensions::switches::kWhitelistedExtensionID, 88 extensions::switches::kWhitelistedExtensionID,
89 "ddchlicdkolnonkihahngkmmmjnjlkkf"); 89 "ddchlicdkolnonkihahngkmmmjnjlkkf");
90 command_line->AppendSwitch(switches::kEnablePrivetV3);
91 } 90 }
92 91
93 scoped_ptr<net::FakeURLFetcher> CreateFakeURLFetcher( 92 scoped_ptr<net::FakeURLFetcher> CreateFakeURLFetcher(
94 const GURL& url, 93 const GURL& url,
95 net::URLFetcherDelegate* fetcher_delegate, 94 net::URLFetcherDelegate* fetcher_delegate,
96 const std::string& response_data, 95 const std::string& response_data,
97 net::HttpStatusCode response_code, 96 net::HttpStatusCode response_code,
98 net::URLRequestStatus::Status status) { 97 net::URLRequestStatus::Status status) {
99 scoped_ptr<net::FakeURLFetcher> fetcher(new net::FakeURLFetcher( 98 scoped_ptr<net::FakeURLFetcher> fetcher(new net::FakeURLFetcher(
100 url, fetcher_delegate, response_data, response_code, status)); 99 url, fetcher_delegate, response_data, response_code, status));
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 test_service_discovery_client_->SimulateReceive(kAnnouncePacket, 152 test_service_discovery_client_->SimulateReceive(kAnnouncePacket,
154 sizeof(kAnnouncePacket)); 153 sizeof(kAnnouncePacket));
155 url_fetcher_factory_.SetFakeResponse(GURL("http://1.2.3.4:8888/privet/info"), 154 url_fetcher_factory_.SetFakeResponse(GURL("http://1.2.3.4:8888/privet/info"),
156 kPrivetInfoResponse, 155 kPrivetInfoResponse,
157 net::HTTP_OK, 156 net::HTTP_OK,
158 net::URLRequestStatus::SUCCESS); 157 net::URLRequestStatus::SUCCESS);
159 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "session.html")); 158 EXPECT_TRUE(RunExtensionSubtest("gcd_private/api", "session.html"));
160 } 159 }
161 160
162 } // namespace 161 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698