Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / browsing_data / mock_browsing_data_channel_id_helper.h
blob96e09cb29bf4d07de6c6ef304a4334d50be93aaf
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_BROWSING_DATA_MOCK_BROWSING_DATA_CHANNEL_ID_HELPER_H_
6 #define CHROME_BROWSER_BROWSING_DATA_MOCK_BROWSING_DATA_CHANNEL_ID_HELPER_H_
8 #include <map>
9 #include <string>
11 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h"
13 // Mock for BrowsingDataChannelIDHelper.
14 class MockBrowsingDataChannelIDHelper
15 : public BrowsingDataChannelIDHelper {
16 public:
17 MockBrowsingDataChannelIDHelper();
19 // BrowsingDataChannelIDHelper methods.
20 void StartFetching(const FetchResultCallback& callback) override;
21 void DeleteChannelID(const std::string& server_id) override;
23 // Adds a channel_id sample.
24 void AddChannelIDSample(const std::string& server_id);
26 // Notifies the callback.
27 void Notify();
29 // Marks all channel_ids as existing.
30 void Reset();
32 // Returns true if all channel_ids since the last Reset() invocation
33 // were deleted.
34 bool AllDeleted();
36 private:
37 ~MockBrowsingDataChannelIDHelper() override;
39 FetchResultCallback callback_;
41 net::ChannelIDStore::ChannelIDList channel_id_list_;
43 // Stores which channel_ids exist.
44 std::map<const std::string, bool> channel_ids_;
46 DISALLOW_COPY_AND_ASSIGN(MockBrowsingDataChannelIDHelper);
49 #endif // CHROME_BROWSER_BROWSING_DATA_MOCK_BROWSING_DATA_CHANNEL_ID_HELPER_H_