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

Unified Diff: components/ukm/test_ukm_service.h

Issue 2893943004: Refactor UKM interface for mojo-ification (Closed)
Patch Set: Fixed contextualsearch Created 3 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/ukm/test_ukm_recorder.cc ('k') | components/ukm/test_ukm_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ukm/test_ukm_service.h
diff --git a/components/ukm/test_ukm_service.h b/components/ukm/test_ukm_service.h
deleted file mode 100644
index 55d5920411dc1042fc045d62efe9fef5f8b62d4f..0000000000000000000000000000000000000000
--- a/components/ukm/test_ukm_service.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_UKM_TEST_UKM_SERVICE_H_
-#define COMPONENTS_UKM_TEST_UKM_SERVICE_H_
-
-#include <stddef.h>
-#include <memory>
-
-#include "components/metrics/test_metrics_service_client.h"
-#include "components/prefs/testing_pref_service.h"
-#include "components/ukm/ukm_pref_names.h"
-#include "components/ukm/ukm_service.h"
-
-namespace ukm {
-
-// Wraps an UkmService with additional accessors used for testing.
-class TestUkmService : public UkmService {
- public:
- explicit TestUkmService(PrefService* pref_service);
- ~TestUkmService() override;
-
- size_t sources_count() const { return sources_for_testing().size(); }
- const std::map<int32_t, std::unique_ptr<UkmSource>>& GetSources() const;
- const UkmSource* GetSourceForUrl(const char* url) const;
- const UkmSource* GetSourceForSourceId(int32_t source_id) const;
-
- size_t entries_count() const { return entries_for_testing().size(); }
- const UkmEntry* GetEntry(size_t entry_num) const;
- const UkmEntry* GetEntryForEntryName(const char* entry_name) const;
-
- private:
- metrics::TestMetricsServiceClient test_metrics_service_client_;
-
- DISALLOW_COPY_AND_ASSIGN(TestUkmService);
-};
-
-// Convenience harness used for testing; creates a TestUkmService and
-// supplies it with a prefs service with a longer lifespan.
-class UkmServiceTestingHarness {
- public:
- UkmServiceTestingHarness();
- virtual ~UkmServiceTestingHarness();
-
- TestUkmService* test_ukm_service() { return test_ukm_service_.get(); }
-
- private:
- TestingPrefServiceSimple test_prefs_;
- std::unique_ptr<TestUkmService> test_ukm_service_;
-
- DISALLOW_COPY_AND_ASSIGN(UkmServiceTestingHarness);
-};
-
-} // namespace ukm
-
-#endif // COMPONENTS_UKM_TEST_UKM_SERVICE_H_
« no previous file with comments | « components/ukm/test_ukm_recorder.cc ('k') | components/ukm/test_ukm_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698