OLD | NEW |
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 <stack> | 5 #include <stack> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 static const int kMockProcessId = 1; | 43 static const int kMockProcessId = 1; |
44 | 44 |
45 class AppCacheRequestHandlerTest : public testing::Test { | 45 class AppCacheRequestHandlerTest : public testing::Test { |
46 public: | 46 public: |
47 class MockFrontend : public AppCacheFrontend { | 47 class MockFrontend : public AppCacheFrontend { |
48 public: | 48 public: |
49 virtual void OnCacheSelected( | 49 virtual void OnCacheSelected( |
50 int host_id, const appcache::AppCacheInfo& info) OVERRIDE {} | 50 int host_id, const appcache::AppCacheInfo& info) OVERRIDE {} |
51 | 51 |
52 virtual void OnStatusChanged(const std::vector<int>& host_ids, | 52 virtual void OnStatusChanged(const std::vector<int>& host_ids, |
53 appcache::Status status) OVERRIDE {} | 53 appcache::AppCacheStatus status) OVERRIDE {} |
54 | 54 |
55 virtual void OnEventRaised(const std::vector<int>& host_ids, | 55 virtual void OnEventRaised(const std::vector<int>& host_ids, |
56 appcache::EventID event_id) OVERRIDE {} | 56 appcache::AppCacheEventID event_id) OVERRIDE {} |
57 | 57 |
58 virtual void OnErrorEventRaised(const std::vector<int>& host_ids, | 58 virtual void OnErrorEventRaised( |
59 const appcache::ErrorDetails& details) | 59 const std::vector<int>& host_ids, |
60 OVERRIDE {} | 60 const appcache::AppCacheErrorDetails& details) OVERRIDE {} |
61 | 61 |
62 virtual void OnProgressEventRaised(const std::vector<int>& host_ids, | 62 virtual void OnProgressEventRaised(const std::vector<int>& host_ids, |
63 const GURL& url, | 63 const GURL& url, |
64 int num_total, | 64 int num_total, |
65 int num_complete) OVERRIDE { | 65 int num_complete) OVERRIDE { |
66 } | 66 } |
67 | 67 |
68 virtual void OnLogMessage(int host_id, | 68 virtual void OnLogMessage(int host_id, |
69 appcache::LogLevel log_level, | 69 appcache::AppCacheLogLevel log_level, |
70 const std::string& message) OVERRIDE { | 70 const std::string& message) OVERRIDE { |
71 } | 71 } |
72 | 72 |
73 virtual void OnContentBlocked(int host_id, | 73 virtual void OnContentBlocked(int host_id, |
74 const GURL& manifest_url) OVERRIDE {} | 74 const GURL& manifest_url) OVERRIDE {} |
75 }; | 75 }; |
76 | 76 |
77 // Helper callback to run a test on our io_thread. The io_thread is spun up | 77 // Helper callback to run a test on our io_thread. The io_thread is spun up |
78 // once and reused for all tests. | 78 // once and reused for all tests. |
79 template <class Method> | 79 template <class Method> |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 | 1005 |
1006 TEST_F(AppCacheRequestHandlerTest, WorkerRequest) { | 1006 TEST_F(AppCacheRequestHandlerTest, WorkerRequest) { |
1007 RunTestOnIOThread(&AppCacheRequestHandlerTest::WorkerRequest); | 1007 RunTestOnIOThread(&AppCacheRequestHandlerTest::WorkerRequest); |
1008 } | 1008 } |
1009 | 1009 |
1010 TEST_F(AppCacheRequestHandlerTest, MainResource_Blocked) { | 1010 TEST_F(AppCacheRequestHandlerTest, MainResource_Blocked) { |
1011 RunTestOnIOThread(&AppCacheRequestHandlerTest::MainResource_Blocked); | 1011 RunTestOnIOThread(&AppCacheRequestHandlerTest::MainResource_Blocked); |
1012 } | 1012 } |
1013 | 1013 |
1014 } // namespace content | 1014 } // namespace content |
OLD | NEW |