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

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

Issue 271263002: New test cases for kiosk app crx file cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improvement based on comments. Created 6 years, 7 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
new file mode 100644
index 0000000000000000000000000000000000000000..c6e3d2fe38979a3bad4f5d798abd7afa19c4c6f1
--- /dev/null
+++ b/chrome/browser/chromeos/app_mode/fake_cws.h
@@ -0,0 +1,56 @@
+// Copyright 2014 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.
+
+#ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_FAKE_CWS_H_
+#define CHROME_BROWSER_CHROMEOS_APP_MODE_FAKE_CWS_H_
+
+#include "net/test/embedded_test_server/embedded_test_server.h"
+#include "net/test/embedded_test_server/http_request.h"
+#include "net/test/embedded_test_server/http_response.h"
+#include "url/gurl.h"
+
+namespace chromeos {
+
+class FakeCWS {
+ public:
+ FakeCWS() {}
+ virtual ~FakeCWS() {}
+
+ void Init(net::test_server::EmbeddedTestServer* embedded_test_server);
+ // Sets up the kiosk app update response.
+ void SetUpdateCrx(const std::string& app_id,
+ const std::string& crx_file,
+ const std::string& version);
+ void SetNoUpdate(const std::string& app_id);
+
+ 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);
+ // 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,
+ const GURL& crx_download_url,
+ const std::string& app_id,
+ const std::string& crx_fp,
+ 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 update_check_content_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeCWS);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_APP_MODE_FAKE_CWS_H_
« 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