OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/thread.h" | 10 #include "base/thread.h" |
11 #include "base/waitable_event.h" | 11 #include "base/waitable_event.h" |
12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
13 #include "net/url_request/url_request.h" | 13 #include "net/url_request/url_request.h" |
14 #include "net/url_request/url_request_error_job.h" | 14 #include "net/url_request/url_request_error_job.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "webkit/appcache/appcache.h" | 16 #include "webkit/appcache/appcache.h" |
17 #include "webkit/appcache/appcache_backend_impl.h" | 17 #include "webkit/appcache/appcache_backend_impl.h" |
18 #include "webkit/appcache/appcache_request_handler.h" | 18 #include "webkit/appcache/appcache_request_handler.h" |
19 #include "webkit/appcache/appcache_url_request_job.h" | 19 #include "webkit/appcache/appcache_url_request_job.h" |
20 #include "webkit/appcache/mock_appcache_service.h" | 20 #include "webkit/appcache/mock_appcache_service.h" |
21 | 21 |
22 namespace appcache { | 22 namespace appcache { |
23 | 23 |
24 static const int kMockProcessId = 1; | 24 static const int kMockProcessId = 1; |
25 | 25 |
26 class AppCacheRequestHandlerTest : public testing::Test { | 26 class AppCacheRequestHandlerTest : public testing::Test { |
27 public: | 27 public: |
28 class MockFrontend : public AppCacheFrontend { | 28 class MockFrontend : public AppCacheFrontend { |
29 public: | 29 public: |
30 virtual void OnCacheSelected(int host_id, int64 cache_id , | 30 virtual void OnCacheSelected( |
31 appcache::Status status) {} | 31 int host_id, const appcache::AppCacheInfo& info) {} |
32 | 32 |
33 virtual void OnStatusChanged(const std::vector<int>& host_ids, | 33 virtual void OnStatusChanged(const std::vector<int>& host_ids, |
34 appcache::Status status) {} | 34 appcache::Status status) {} |
35 | 35 |
36 virtual void OnEventRaised(const std::vector<int>& host_ids, | 36 virtual void OnEventRaised(const std::vector<int>& host_ids, |
37 appcache::EventID event_id) {} | 37 appcache::EventID event_id) {} |
38 | 38 |
39 virtual void OnErrorEventRaised(const std::vector<int>& host_ids, | 39 virtual void OnErrorEventRaised(const std::vector<int>& host_ids, |
40 const std::string& message) {} | 40 const std::string& message) {} |
41 | 41 |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 | 733 |
734 TEST_F(AppCacheRequestHandlerTest, WorkerRequest) { | 734 TEST_F(AppCacheRequestHandlerTest, WorkerRequest) { |
735 RunTestOnIOThread(&AppCacheRequestHandlerTest::WorkerRequest); | 735 RunTestOnIOThread(&AppCacheRequestHandlerTest::WorkerRequest); |
736 } | 736 } |
737 | 737 |
738 } // namespace appcache | 738 } // namespace appcache |
739 | 739 |
740 // AppCacheRequestHandlerTest is expected to always live longer than the | 740 // AppCacheRequestHandlerTest is expected to always live longer than the |
741 // runnable methods. This lets us call NewRunnableMethod on its instances. | 741 // runnable methods. This lets us call NewRunnableMethod on its instances. |
742 DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheRequestHandlerTest); | 742 DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheRequestHandlerTest); |
OLD | NEW |