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

Unified Diff: chrome/browser/chromeos/app_mode/fake_cws.h

Issue 676913002: kiosk: Support update url for enterprise. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/app_mode/fake_cws.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/app_mode/fake_cws.h
diff --git a/chrome/browser/chromeos/app_mode/fake_cws.h b/chrome/browser/chromeos/app_mode/fake_cws.h
index c6e3d2fe38979a3bad4f5d798abd7afa19c4c6f1..de25896487d85cfb4b13ec7a465665ee9b3bd74e 100644
--- a/chrome/browser/chromeos/app_mode/fake_cws.h
+++ b/chrome/browser/chromeos/app_mode/fake_cws.h
@@ -12,26 +12,41 @@
namespace chromeos {
+// Simple fake CWS update check request handler that returns a fixed update
+// check response. The response is created either from SetUpdateCrx() or
+// SetNoUpdate().
class FakeCWS {
public:
- FakeCWS() {}
- virtual ~FakeCWS() {}
+ FakeCWS();
+ ~FakeCWS();
+ // Initializes as CWS request handler and overrides app gallery command line
+ // switches.
void Init(net::test_server::EmbeddedTestServer* embedded_test_server);
- // Sets up the kiosk app update response.
+
+ // Initializes as a private store handler using the given server and URL end
+ // point. Private store does not override app gallery command lines and use a
+ // slightly different template (as documented on
+ // https://developer.chrome.com/extensions/autoupdate).
+ void InitAsPrivateStore(
+ net::test_server::EmbeddedTestServer* embedded_test_server,
+ const std::string& update_check_end_point);
+
+ // Sets up the update check response with has_update template.
void SetUpdateCrx(const std::string& app_id,
const std::string& crx_file,
const std::string& version);
+
+ // Sets up the update check response with no_update template.
void SetNoUpdate(const std::string& app_id);
+ // Returns the current |update_check_count_| and resets it.
+ int GetUpdateCheckCountAndReset();
+
private:
- void SetupWebStore(const GURL& test_server_url);
- void SetupWebStoreGalleryUrl();
- void SetupCrxDownloadAndUpdateUrls(
- net::test_server::EmbeddedTestServer* embedded_test_server);
- void SetupCrxDownloadUrl();
- void SetupCrxUpdateUrl(
- net::test_server::EmbeddedTestServer* embedded_test_server);
+ void SetupWebStoreURL(const GURL& test_server_url);
+ void OverrideGalleryCommandlineSwitches();
+
// Sets up |update_check_content_| used in update request response later by
// kiosk app update server request handler |HandleRequest|.
void SetUpdateCheckContent(const std::string& update_check_file,
@@ -41,12 +56,19 @@ class FakeCWS {
const std::string& crx_size,
const std::string& version,
std::string* update_check_content);
+
// Request handler for kiosk app update server.
scoped_ptr<net::test_server::HttpResponse> HandleRequest(
const net::test_server::HttpRequest& request);
GURL web_store_url_;
+
+ std::string has_update_template_;
+ std::string no_update_template_;
+ std::string update_check_end_point_;
+
std::string update_check_content_;
+ int update_check_count_;
DISALLOW_COPY_AND_ASSIGN(FakeCWS);
};
« no previous file with comments | « no previous file | chrome/browser/chromeos/app_mode/fake_cws.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698