Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(747)

Side by Side Diff: content/browser/appcache/mock_appcache_storage_unittest.cc

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/run_loop.h" 5 #include "base/run_loop.h"
6 #include "content/browser/appcache/appcache.h" 6 #include "content/browser/appcache/appcache.h"
7 #include "content/browser/appcache/appcache_group.h" 7 #include "content/browser/appcache/appcache_group.h"
8 #include "content/browser/appcache/appcache_response.h" 8 #include "content/browser/appcache/appcache_response.h"
9 #include "content/browser/appcache/appcache_storage.h" 9 #include "content/browser/appcache/appcache_storage.h"
10 #include "content/browser/appcache/mock_appcache_service.h" 10 #include "content/browser/appcache/mock_appcache_service.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 class MockAppCacheStorageTest : public testing::Test { 15 class MockAppCacheStorageTest : public testing::Test {
16 public: 16 public:
17 class MockStorageDelegate : public AppCacheStorage::Delegate { 17 class MockStorageDelegate : public AppCacheStorage::Delegate {
18 public: 18 public:
19 explicit MockStorageDelegate() 19 explicit MockStorageDelegate()
20 : loaded_cache_id_(0), stored_group_success_(false), 20 : loaded_cache_id_(0), stored_group_success_(false),
21 obsoleted_success_(false), found_cache_id_(kAppCacheNoCacheId) { 21 obsoleted_success_(false), found_cache_id_(kAppCacheNoCacheId) {
22 } 22 }
23 23
24 virtual void OnCacheLoaded(AppCache* cache, int64 cache_id) override { 24 void OnCacheLoaded(AppCache* cache, int64 cache_id) override {
25 loaded_cache_ = cache; 25 loaded_cache_ = cache;
26 loaded_cache_id_ = cache_id; 26 loaded_cache_id_ = cache_id;
27 } 27 }
28 28
29 virtual void OnGroupLoaded(AppCacheGroup* group, 29 void OnGroupLoaded(AppCacheGroup* group,
30 const GURL& manifest_url) override { 30 const GURL& manifest_url) override {
31 loaded_group_ = group; 31 loaded_group_ = group;
32 loaded_manifest_url_ = manifest_url; 32 loaded_manifest_url_ = manifest_url;
33 } 33 }
34 34
35 virtual void OnGroupAndNewestCacheStored( 35 void OnGroupAndNewestCacheStored(AppCacheGroup* group,
36 AppCacheGroup* group, AppCache* newest_cache, bool success, 36 AppCache* newest_cache,
37 bool would_exceed_quota) override { 37 bool success,
38 bool would_exceed_quota) override {
38 stored_group_ = group; 39 stored_group_ = group;
39 stored_group_success_ = success; 40 stored_group_success_ = success;
40 } 41 }
41 42
42 virtual void OnGroupMadeObsolete(AppCacheGroup* group, 43 void OnGroupMadeObsolete(AppCacheGroup* group,
43 bool success, 44 bool success,
44 int response_code) override { 45 int response_code) override {
45 obsoleted_group_ = group; 46 obsoleted_group_ = group;
46 obsoleted_success_ = success; 47 obsoleted_success_ = success;
47 } 48 }
48 49
49 virtual void OnMainResponseFound(const GURL& url, 50 void OnMainResponseFound(const GURL& url,
50 const AppCacheEntry& entry, 51 const AppCacheEntry& entry,
51 const GURL& fallback_url, 52 const GURL& fallback_url,
52 const AppCacheEntry& fallback_entry, 53 const AppCacheEntry& fallback_entry,
53 int64 cache_id, 54 int64 cache_id,
54 int64 group_id, 55 int64 group_id,
55 const GURL& manifest_url) override { 56 const GURL& manifest_url) override {
56 found_url_ = url; 57 found_url_ = url;
57 found_entry_ = entry; 58 found_entry_ = entry;
58 found_fallback_url_ = fallback_url; 59 found_fallback_url_ = fallback_url;
59 found_fallback_entry_ = fallback_entry; 60 found_fallback_entry_ = fallback_entry;
60 found_cache_id_ = cache_id; 61 found_cache_id_ = cache_id;
61 found_manifest_url_ = manifest_url; 62 found_manifest_url_ = manifest_url;
62 } 63 }
63 64
64 scoped_refptr<AppCache> loaded_cache_; 65 scoped_refptr<AppCache> loaded_cache_;
65 int64 loaded_cache_id_; 66 int64 loaded_cache_id_;
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 EXPECT_EQ(kAppCacheNoCacheId, delegate.found_cache_id_); 626 EXPECT_EQ(kAppCacheNoCacheId, delegate.found_cache_id_);
626 EXPECT_EQ(kAppCacheNoResponseId, delegate.found_entry_.response_id()); 627 EXPECT_EQ(kAppCacheNoResponseId, delegate.found_entry_.response_id());
627 EXPECT_EQ(kAppCacheNoResponseId, 628 EXPECT_EQ(kAppCacheNoResponseId,
628 delegate.found_fallback_entry_.response_id()); 629 delegate.found_fallback_entry_.response_id());
629 EXPECT_TRUE(delegate.found_fallback_url_.is_empty()); 630 EXPECT_TRUE(delegate.found_fallback_url_.is_empty());
630 EXPECT_EQ(0, delegate.found_entry_.types()); 631 EXPECT_EQ(0, delegate.found_entry_.types());
631 EXPECT_EQ(0, delegate.found_fallback_entry_.types()); 632 EXPECT_EQ(0, delegate.found_fallback_entry_.types());
632 } 633 }
633 634
634 } // namespace content 635 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/appcache/mock_appcache_storage.h ('k') | content/browser/appcache/view_appcache_internals_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698