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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/scoped_observer.h" | 6 #include "base/scoped_observer.h" |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/extensions/activity_log/activity_actions.h" | 9 #include "chrome/browser/extensions/activity_log/activity_actions.h" |
10 #include "chrome/browser/extensions/activity_log/activity_log.h" | 10 #include "chrome/browser/extensions/activity_log/activity_log.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 ++injection_count_; | 84 ++injection_count_; |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 // A mock for the AdNetworkDatabase. This simply says that the URL | 88 // A mock for the AdNetworkDatabase. This simply says that the URL |
89 // http://www.known-ads.adnetwork is an ad network, and nothing else is. | 89 // http://www.known-ads.adnetwork is an ad network, and nothing else is. |
90 class TestAdNetworkDatabase : public AdNetworkDatabase { | 90 class TestAdNetworkDatabase : public AdNetworkDatabase { |
91 public: | 91 public: |
92 TestAdNetworkDatabase(); | 92 TestAdNetworkDatabase(); |
93 virtual ~TestAdNetworkDatabase(); | 93 virtual ~TestAdNetworkDatabase(); |
| 94 |
| 95 private: |
94 virtual bool IsAdNetwork(const GURL& url) const OVERRIDE; | 96 virtual bool IsAdNetwork(const GURL& url) const OVERRIDE; |
95 | 97 |
96 private: | |
97 GURL ad_network_url_; | 98 GURL ad_network_url_; |
98 }; | 99 }; |
99 | 100 |
100 TestAdNetworkDatabase::TestAdNetworkDatabase() : ad_network_url_(kAdNetwork) {} | 101 TestAdNetworkDatabase::TestAdNetworkDatabase() : ad_network_url_(kAdNetwork) {} |
101 TestAdNetworkDatabase::~TestAdNetworkDatabase() {} | 102 TestAdNetworkDatabase::~TestAdNetworkDatabase() {} |
102 | 103 |
103 bool TestAdNetworkDatabase::IsAdNetwork(const GURL& url) const { | 104 bool TestAdNetworkDatabase::IsAdNetwork(const GURL& url) const { |
104 return url == ad_network_url_; | 105 return url == ad_network_url_; |
105 } | 106 } |
106 | 107 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 listener()->Reply("Continue"); | 337 listener()->Reply("Continue"); |
337 listener()->Reset(); | 338 listener()->Reset(); |
338 } | 339 } |
339 } | 340 } |
340 | 341 |
341 // TODO(rdevlin.cronin): We test a good amount of ways of injecting ads with | 342 // TODO(rdevlin.cronin): We test a good amount of ways of injecting ads with |
342 // the above test, but more is better in testing. | 343 // the above test, but more is better in testing. |
343 // See crbug.com/357204. | 344 // See crbug.com/357204. |
344 | 345 |
345 } // namespace extensions | 346 } // namespace extensions |
OLD | NEW |