Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_FAKE_CWS_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_FAKE_CWS_H_ | |
| 7 | |
| 8 #include "net/test/embedded_test_server/embedded_test_server.h" | |
| 9 #include "net/test/embedded_test_server/http_request.h" | |
| 10 #include "net/test/embedded_test_server/http_response.h" | |
| 11 #include "url/gurl.h" | |
| 12 | |
| 13 using net::test_server::HttpRequest; | |
| 14 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.
| |
| 15 | |
| 16 using net::test_server::EmbeddedTestServer; | |
| 17 | |
| 18 namespace chromeos { | |
| 19 | |
| 20 class FakeCWS { | |
| 21 public: | |
| 22 FakeCWS() {} | |
| 23 virtual ~FakeCWS() {} | |
| 24 | |
| 25 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
| |
| 26 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.
| |
| 27 // Sets up the kiosk app update response. | |
| 28 void SetUpdateCrx(const std::string& app_id, | |
| 29 const std::string& crx_file, | |
| 30 const std::string& version); | |
| 31 void SetNoUpdate(const std::string& app_id); | |
| 32 | |
| 33 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.
| |
| 34 | |
| 35 private: | |
| 36 void SetupWebStore(const GURL& test_server_url); | |
| 37 void SetupWebStoreGalleryUrl(); | |
| 38 void SetupCrxDownloadUrl(); | |
| 39 void SetupCrxUpdateUrl(EmbeddedTestServer* embedded_test_server); | |
| 40 // Sets up |update_check_content_| used in update request response later by | |
| 41 // kiosk app update server request handler |HandleRequest|. | |
| 42 void SetUpdateCheckContent(const std::string& update_check_file, | |
| 43 const GURL& crx_download_url, | |
| 44 const std::string& app_id, | |
| 45 const std::string& crx_fp, | |
| 46 const std::string& crx_size, | |
| 47 const std::string& version, | |
| 48 std::string* update_check_content); | |
| 49 // Request handler for kiosk app update server. | |
| 50 scoped_ptr<HttpResponse> HandleRequest(const HttpRequest& request); | |
| 51 | |
| 52 GURL web_store_url_; | |
| 53 std::string update_check_content_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(FakeCWS); | |
| 56 }; | |
| 57 | |
| 58 } // namespace chromeos | |
| 59 | |
| 60 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_FAKE_CWS_H_ | |
| OLD | NEW |