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