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 "components/search/search.h" | 5 #include "components/search/search.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/field_trial.h" | |
9 #include "base/metrics/statistics_recorder.h" | |
10 #include "components/search/search.h" | 8 #include "components/search/search.h" |
11 #include "components/search/search_switches.h" | 9 #include "components/search/search_switches.h" |
12 #include "components/variations/entropy_provider.h" | |
13 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
14 | 11 |
15 namespace search { | 12 namespace search { |
16 | 13 |
17 namespace { | 14 namespace { |
18 | 15 |
19 TEST(SearchTest, EmbeddedSearchAPIEnabled) { | 16 TEST(SearchTest, EmbeddedSearchAPIEnabled) { |
20 EXPECT_EQ(1ul, EmbeddedSearchPageVersion()); | 17 EXPECT_EQ(1ul, EmbeddedSearchPageVersion()); |
21 EXPECT_FALSE(IsInstantExtendedAPIEnabled()); | 18 EXPECT_FALSE(IsInstantExtendedAPIEnabled()); |
22 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 19 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
23 switches::kEnableEmbeddedSearchAPI); | 20 switches::kEnableEmbeddedSearchAPI); |
24 EXPECT_EQ(2ul, EmbeddedSearchPageVersion()); | 21 EXPECT_EQ(2ul, EmbeddedSearchPageVersion()); |
25 EXPECT_TRUE(IsInstantExtendedAPIEnabled()); | 22 EXPECT_TRUE(IsInstantExtendedAPIEnabled()); |
26 } | 23 } |
27 | 24 |
28 TEST(SearchTest, QueryExtractionEnabled) { | |
29 // Query extraction is disabled on mobile. | |
30 EXPECT_FALSE(IsQueryExtractionEnabled()); | |
31 } | |
32 | |
33 } // namespace | 25 } // namespace |
34 | 26 |
35 } // namespace chrome | 27 } // namespace chrome |
OLD | NEW |