| 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 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 using appcache::AppCacheEntry; | 41 using appcache::AppCacheEntry; |
| 42 using appcache::AppCacheFrontend; | 42 using appcache::AppCacheFrontend; |
| 43 using appcache::AppCacheHost; | 43 using appcache::AppCacheHost; |
| 44 using appcache::AppCacheInfo; | 44 using appcache::AppCacheInfo; |
| 45 using appcache::AppCacheGroup; | 45 using appcache::AppCacheGroup; |
| 46 using appcache::AppCacheServiceImpl; | 46 using appcache::AppCacheServiceImpl; |
| 47 using appcache::AppCacheStorage; | 47 using appcache::AppCacheStorage; |
| 48 using appcache::AppCacheStorageImpl; | 48 using appcache::AppCacheStorageImpl; |
| 49 using appcache::AppCacheStorageReference; | 49 using appcache::AppCacheStorageReference; |
| 50 using appcache::AppCache; | 50 using appcache::AppCache; |
| 51 using appcache::ErrorDetails; | 51 using appcache::AppCacheErrorDetails; |
| 52 using appcache::EventID; | 52 using appcache::AppCacheEventID; |
| 53 using appcache::kNoCacheId; | 53 using appcache::kNoCacheId; |
| 54 using appcache::kNoResponseId; | 54 using appcache::kNoResponseId; |
| 55 using appcache::INTERCEPT_NAMESPACE; | 55 using appcache::INTERCEPT_NAMESPACE; |
| 56 using appcache::LogLevel; | 56 using appcache::AppCacheLogLevel; |
| 57 using appcache::Namespace; | 57 using appcache::Namespace; |
| 58 using appcache::Status; | 58 using appcache::AppCacheStatus; |
| 59 | 59 |
| 60 namespace content { | 60 namespace content { |
| 61 | 61 |
| 62 namespace { | 62 namespace { |
| 63 | 63 |
| 64 const base::Time kZeroTime; | 64 const base::Time kZeroTime; |
| 65 const GURL kManifestUrl("http://blah/manifest"); | 65 const GURL kManifestUrl("http://blah/manifest"); |
| 66 const GURL kManifestUrl2("http://blah/manifest2"); | 66 const GURL kManifestUrl2("http://blah/manifest2"); |
| 67 const GURL kManifestUrl3("http://blah/manifest3"); | 67 const GURL kManifestUrl3("http://blah/manifest3"); |
| 68 const GURL kEntryUrl("http://blah/entry"); | 68 const GURL kEntryUrl("http://blah/entry"); |
| (...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1616 AppCacheStorageImplTest* test_; | 1616 AppCacheStorageImplTest* test_; |
| 1617 }; | 1617 }; |
| 1618 | 1618 |
| 1619 class MockAppCacheFrontend : public AppCacheFrontend { | 1619 class MockAppCacheFrontend : public AppCacheFrontend { |
| 1620 public: | 1620 public: |
| 1621 MockAppCacheFrontend() : error_event_was_raised_(false) {} | 1621 MockAppCacheFrontend() : error_event_was_raised_(false) {} |
| 1622 | 1622 |
| 1623 virtual void OnCacheSelected( | 1623 virtual void OnCacheSelected( |
| 1624 int host_id, const AppCacheInfo& info) OVERRIDE {} | 1624 int host_id, const AppCacheInfo& info) OVERRIDE {} |
| 1625 virtual void OnStatusChanged(const std::vector<int>& host_ids, | 1625 virtual void OnStatusChanged(const std::vector<int>& host_ids, |
| 1626 Status status) OVERRIDE {} | 1626 AppCacheStatus status) OVERRIDE {} |
| 1627 virtual void OnEventRaised(const std::vector<int>& host_ids, | 1627 virtual void OnEventRaised(const std::vector<int>& host_ids, |
| 1628 EventID event_id) OVERRIDE {} | 1628 AppCacheEventID event_id) OVERRIDE {} |
| 1629 virtual void OnProgressEventRaised( | 1629 virtual void OnProgressEventRaised( |
| 1630 const std::vector<int>& host_ids, | 1630 const std::vector<int>& host_ids, |
| 1631 const GURL& url, | 1631 const GURL& url, |
| 1632 int num_total, int num_complete) OVERRIDE {} | 1632 int num_total, int num_complete) OVERRIDE {} |
| 1633 virtual void OnErrorEventRaised(const std::vector<int>& host_ids, | 1633 virtual void OnErrorEventRaised(const std::vector<int>& host_ids, |
| 1634 const ErrorDetails& details) | 1634 const AppCacheErrorDetails& details) |
| 1635 OVERRIDE { | 1635 OVERRIDE { |
| 1636 error_event_was_raised_ = true; | 1636 error_event_was_raised_ = true; |
| 1637 } | 1637 } |
| 1638 virtual void OnLogMessage(int host_id, LogLevel log_level, | 1638 virtual void OnLogMessage(int host_id, AppCacheLogLevel log_level, |
| 1639 const std::string& message) OVERRIDE {} | 1639 const std::string& message) OVERRIDE {} |
| 1640 virtual void OnContentBlocked( | 1640 virtual void OnContentBlocked( |
| 1641 int host_id, const GURL& manifest_url) OVERRIDE {} | 1641 int host_id, const GURL& manifest_url) OVERRIDE {} |
| 1642 | 1642 |
| 1643 bool error_event_was_raised_; | 1643 bool error_event_was_raised_; |
| 1644 }; | 1644 }; |
| 1645 | 1645 |
| 1646 enum ReinitTestCase { | 1646 enum ReinitTestCase { |
| 1647 CORRUPT_CACHE_ON_INSTALL, | 1647 CORRUPT_CACHE_ON_INSTALL, |
| 1648 CORRUPT_CACHE_ON_LOAD_EXISTING, | 1648 CORRUPT_CACHE_ON_LOAD_EXISTING, |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2025 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2); | 2025 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2); |
| 2026 } | 2026 } |
| 2027 | 2027 |
| 2028 TEST_F(AppCacheStorageImplTest, Reinitialize3) { | 2028 TEST_F(AppCacheStorageImplTest, Reinitialize3) { |
| 2029 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3); | 2029 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3); |
| 2030 } | 2030 } |
| 2031 | 2031 |
| 2032 // That's all folks! | 2032 // That's all folks! |
| 2033 | 2033 |
| 2034 } // namespace content | 2034 } // namespace content |
| OLD | NEW |