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

Side by Side Diff: chrome/browser/chromeos/app_mode/fake_cws.cc

Issue 1488393002: Check import module update before launching the primary kiosk app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix browser tests and address code review commnents. Created 5 years 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 "chrome/browser/chromeos/app_mode/fake_cws.h" 5 #include "chrome/browser/chromeos/app_mode/fake_cws.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 base::Bind(&FakeCWS::HandleRequest, base::Unretained(this))); 86 base::Bind(&FakeCWS::HandleRequest, base::Unretained(this)));
87 } 87 }
88 88
89 void FakeCWS::InitAsPrivateStore(net::EmbeddedTestServer* embedded_test_server, 89 void FakeCWS::InitAsPrivateStore(net::EmbeddedTestServer* embedded_test_server,
90 const std::string& update_check_end_point) { 90 const std::string& update_check_end_point) {
91 has_update_template_ = kPrivateStoreAppHasUpdateTemplate; 91 has_update_template_ = kPrivateStoreAppHasUpdateTemplate;
92 no_update_template_ = kAppNoUpdateTemplate; 92 no_update_template_ = kAppNoUpdateTemplate;
93 update_check_end_point_ = update_check_end_point; 93 update_check_end_point_ = update_check_end_point;
94 94
95 SetupWebStoreURL(embedded_test_server->base_url()); 95 SetupWebStoreURL(embedded_test_server->base_url());
96
97 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
98 GURL update_url = web_store_url_.Resolve(update_check_end_point_);
99 command_line->AppendSwitchASCII(::switches::kAppsGalleryUpdateURL,
100 update_url.spec());
xiyuan 2015/12/03 00:46:53 OverrideGalleryCommandlineSwitches() does this too
jennyz 2015/12/03 01:23:47 Done.
101
96 embedded_test_server->RegisterRequestHandler( 102 embedded_test_server->RegisterRequestHandler(
97 base::Bind(&FakeCWS::HandleRequest, base::Unretained(this))); 103 base::Bind(&FakeCWS::HandleRequest, base::Unretained(this)));
98 } 104 }
99 105
100 void FakeCWS::SetUpdateCrx(const std::string& app_id, 106 void FakeCWS::SetUpdateCrx(const std::string& app_id,
101 const std::string& crx_file, 107 const std::string& crx_file,
102 const std::string& version) { 108 const std::string& version) {
103 GURL crx_download_url = web_store_url_.Resolve(kCrxDownloadPath + crx_file); 109 GURL crx_download_url = web_store_url_.Resolve(kCrxDownloadPath + crx_file);
104 110
105 base::FilePath test_data_dir; 111 base::FilePath test_data_dir;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 http_response->set_content(update_check_content); 206 http_response->set_content(update_check_content);
201 return http_response.Pass(); 207 return http_response.Pass();
202 } 208 }
203 } 209 }
204 } 210 }
205 211
206 return scoped_ptr<HttpResponse>(); 212 return scoped_ptr<HttpResponse>();
207 } 213 }
208 214
209 } // namespace chromeos 215 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698