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 "content/browser/appcache/appcache.h" | 5 #include "content/browser/appcache/appcache.h" |
6 #include "content/browser/appcache/appcache_host.h" | 6 #include "content/browser/appcache/appcache_host.h" |
7 #include "content/browser/appcache/mock_appcache_service.h" | 7 #include "content/browser/appcache/mock_appcache_service.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 class MockAppCacheFrontend : public AppCacheFrontend { | 14 class MockAppCacheFrontend : public AppCacheFrontend { |
15 public: | 15 public: |
16 virtual void OnCacheSelected(int host_id, const AppCacheInfo& info) OVERRIDE { | 16 virtual void OnCacheSelected(int host_id, const AppCacheInfo& info) override { |
17 } | 17 } |
18 virtual void OnStatusChanged(const std::vector<int>& host_ids, | 18 virtual void OnStatusChanged(const std::vector<int>& host_ids, |
19 AppCacheStatus status) OVERRIDE {} | 19 AppCacheStatus status) override {} |
20 virtual void OnEventRaised(const std::vector<int>& host_ids, | 20 virtual void OnEventRaised(const std::vector<int>& host_ids, |
21 AppCacheEventID event_id) OVERRIDE {} | 21 AppCacheEventID event_id) override {} |
22 virtual void OnProgressEventRaised( | 22 virtual void OnProgressEventRaised( |
23 const std::vector<int>& host_ids, | 23 const std::vector<int>& host_ids, |
24 const GURL& url, | 24 const GURL& url, |
25 int num_total, int num_complete) OVERRIDE {} | 25 int num_total, int num_complete) override {} |
26 virtual void OnErrorEventRaised( | 26 virtual void OnErrorEventRaised( |
27 const std::vector<int>& host_ids, | 27 const std::vector<int>& host_ids, |
28 const AppCacheErrorDetails& details) OVERRIDE {} | 28 const AppCacheErrorDetails& details) override {} |
29 virtual void OnLogMessage(int host_id, AppCacheLogLevel log_level, | 29 virtual void OnLogMessage(int host_id, AppCacheLogLevel log_level, |
30 const std::string& message) OVERRIDE {} | 30 const std::string& message) override {} |
31 virtual void OnContentBlocked( | 31 virtual void OnContentBlocked( |
32 int host_id, const GURL& manifest_url) OVERRIDE {} | 32 int host_id, const GURL& manifest_url) override {} |
33 }; | 33 }; |
34 | 34 |
35 } // namespace | 35 } // namespace |
36 | 36 |
37 class AppCacheTest : public testing::Test { | 37 class AppCacheTest : public testing::Test { |
38 }; | 38 }; |
39 | 39 |
40 TEST(AppCacheTest, CleanupUnusedCache) { | 40 TEST(AppCacheTest, CleanupUnusedCache) { |
41 MockAppCacheService service; | 41 MockAppCacheService service; |
42 MockAppCacheFrontend frontend; | 42 MockAppCacheFrontend frontend; |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 EXPECT_TRUE(star_greediness.IsMatch( | 692 EXPECT_TRUE(star_greediness.IsMatch( |
693 GURL("http://foo.com/a/b/01234567890abcdef/b"))); | 693 GURL("http://foo.com/a/b/01234567890abcdef/b"))); |
694 EXPECT_TRUE(star_greediness.IsMatch( | 694 EXPECT_TRUE(star_greediness.IsMatch( |
695 GURL("http://foo.com/a/b/01234567890abcdef/b01234567890abcdef/b"))); | 695 GURL("http://foo.com/a/b/01234567890abcdef/b01234567890abcdef/b"))); |
696 EXPECT_TRUE(star_greediness.IsMatch( | 696 EXPECT_TRUE(star_greediness.IsMatch( |
697 GURL("http://foo.com/a/b/01234567890abcdef_eat_some_more_characters_" | 697 GURL("http://foo.com/a/b/01234567890abcdef_eat_some_more_characters_" |
698 "/and_even_more_for_the_heck_of_it/01234567890abcdef/b"))); | 698 "/and_even_more_for_the_heck_of_it/01234567890abcdef/b"))); |
699 } | 699 } |
700 | 700 |
701 } // namespace content | 701 } // namespace content |
OLD | NEW |