OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/values.h" | 5 #include "base/values.h" |
6 #include "chrome/browser/extensions/extension_omnibox_api.h" | 6 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "testing/platform_test.h" | 8 #include "testing/platform_test.h" |
9 | 9 |
| 10 namespace extensions { |
| 11 |
10 namespace { | 12 namespace { |
11 | 13 |
12 const int kNone = ACMatchClassification::NONE; | 14 const int kNone = ACMatchClassification::NONE; |
13 const int kUrl = ACMatchClassification::URL; | 15 const int kUrl = ACMatchClassification::URL; |
14 const int kMatch = ACMatchClassification::MATCH; | 16 const int kMatch = ACMatchClassification::MATCH; |
15 const int kDim = ACMatchClassification::DIM; | 17 const int kDim = ACMatchClassification::DIM; |
16 | 18 |
17 void AppendStyle(const std::string& type, | 19 void AppendStyle(const std::string& type, |
18 int offset, int length, | 20 int offset, int length, |
19 ListValue* styles) { | 21 ListValue* styles) { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 126 |
125 ACMatchClassifications styles_expected; | 127 ACMatchClassifications styles_expected; |
126 styles_expected.push_back(ACMatchClassification(0, kUrl | kMatch | kDim)); | 128 styles_expected.push_back(ACMatchClassification(0, kUrl | kMatch | kDim)); |
127 styles_expected.push_back(ACMatchClassification(5, kNone)); | 129 styles_expected.push_back(ACMatchClassification(5, kNone)); |
128 | 130 |
129 ExtensionOmniboxSuggestion suggestions; | 131 ExtensionOmniboxSuggestion suggestions; |
130 suggestions.description.resize(10); | 132 suggestions.description.resize(10); |
131 EXPECT_TRUE(suggestions.ReadStylesFromValue(styles_value)); | 133 EXPECT_TRUE(suggestions.ReadStylesFromValue(styles_value)); |
132 CompareClassification(styles_expected, suggestions.description_styles); | 134 CompareClassification(styles_expected, suggestions.description_styles); |
133 } | 135 } |
| 136 |
| 137 } // namespace extensions |
OLD | NEW |