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

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: Nit: remove a unused variable. 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
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..6e5c9e5632e31897fadec4a7d8a4f0ec773ebb6f
--- /dev/null
+++ b/chrome/browser/chromeos/app_mode/fake_cws.h
@@ -0,0 +1,60 @@
+// 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"
+
+using net::test_server::HttpRequest;
+using net::test_server::HttpResponse;
xiyuan 2014/05/13 16:43:35 "using" is not allowed in header file.
jennyz 2014/05/13 18:36:11 Done.
+
+using net::test_server::EmbeddedTestServer;
+
+namespace chromeos {
+
+class FakeCWS {
+ public:
+ FakeCWS() {}
+ virtual ~FakeCWS() {}
+
+ void Init(EmbeddedTestServer* embedded_test_server, bool setup_gallery_only);
xiyuan 2014/05/13 16:43:35 We probably can setup everything all the time and
jennyz 2014/05/13 18:36:11 yes, changed to always mock all urls. This makes s
+ void SetupCrxDownloadAndUpdateUrls(EmbeddedTestServer* embedded_test_server);
xiyuan 2014/05/13 16:43:35 No need to expose this if we setup everything all
jennyz 2014/05/13 18:36:11 Done.
+ // 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);
+
+ std::string GetWebStoreDomain() const;
xiyuan 2014/05/13 16:43:35 nit: probably no need to expose this.
jennyz 2014/05/13 18:36:11 Done.
+
+ private:
+ void SetupWebStore(const GURL& test_server_url);
+ void SetupWebStoreGalleryUrl();
+ void SetupCrxDownloadUrl();
+ void SetupCrxUpdateUrl(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<HttpResponse> HandleRequest(const 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_

Powered by Google App Engine
This is Rietveld 408576698