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: | |
felt
2014/04/23 03:01:36
Is there any reason why the browsertest has differ
Devlin
2014/04/23 18:16:55
Yeah, it's a C++ trick that we commonly do in orde
| |
96 // AdNetworkDatabase implementation. | |
97 virtual bool IsEnabled() const OVERRIDE { return true; } | |
94 virtual bool IsAdNetwork(const GURL& url) const OVERRIDE; | 98 virtual bool IsAdNetwork(const GURL& url) const OVERRIDE; |
95 | 99 |
96 private: | |
97 GURL ad_network_url_; | 100 GURL ad_network_url_; |
98 }; | 101 }; |
99 | 102 |
100 TestAdNetworkDatabase::TestAdNetworkDatabase() : ad_network_url_(kAdNetwork) {} | 103 TestAdNetworkDatabase::TestAdNetworkDatabase() : ad_network_url_(kAdNetwork) {} |
101 TestAdNetworkDatabase::~TestAdNetworkDatabase() {} | 104 TestAdNetworkDatabase::~TestAdNetworkDatabase() {} |
102 | 105 |
103 bool TestAdNetworkDatabase::IsAdNetwork(const GURL& url) const { | 106 bool TestAdNetworkDatabase::IsAdNetwork(const GURL& url) const { |
104 return url == ad_network_url_; | 107 return url == ad_network_url_; |
105 } | 108 } |
106 | 109 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
336 listener()->Reply("Continue"); | 339 listener()->Reply("Continue"); |
337 listener()->Reset(); | 340 listener()->Reset(); |
338 } | 341 } |
339 } | 342 } |
340 | 343 |
341 // TODO(rdevlin.cronin): We test a good amount of ways of injecting ads with | 344 // TODO(rdevlin.cronin): We test a good amount of ways of injecting ads with |
342 // the above test, but more is better in testing. | 345 // the above test, but more is better in testing. |
343 // See crbug.com/357204. | 346 // See crbug.com/357204. |
344 | 347 |
345 } // namespace extensions | 348 } // namespace extensions |
OLD | NEW |