entity_annotator_native_library_unittest.cc 929 B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2022 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.
  4. #include "components/optimization_guide/core/entity_annotator_native_library.h"
  5. #include "base/test/metrics/histogram_tester.h"
  6. #include "testing/gtest/include/gtest/gtest.h"
  7. namespace optimization_guide {
  8. namespace {
  9. using EntityAnnotatorNativeLibraryTest = ::testing::Test;
  10. TEST_F(EntityAnnotatorNativeLibraryTest, CanCreateValidLibrary) {
  11. base::HistogramTester histogram_tester;
  12. std::unique_ptr<EntityAnnotatorNativeLibrary> lib =
  13. EntityAnnotatorNativeLibrary::Create(/*should_provide_filter_path=*/true);
  14. ASSERT_TRUE(lib);
  15. EXPECT_TRUE(lib->IsValid());
  16. histogram_tester.ExpectUniqueSample(
  17. "OptimizationGuide.EntityAnnotatorNativeLibrary.InitiatedSuccessfully",
  18. true, 1);
  19. }
  20. } // namespace
  21. } // namespace optimization_guide