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

Side by Side Diff: components/search_engines/template_url_unittest.cc

Issue 2487633003: Change behaivor to decide whether a search engine should be shown in the default list (Closed)
Patch Set: Update based on Peter and Nicolas's comments. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 const std::string& name, 47 const std::string& name,
48 const std::string& value, 48 const std::string& value,
49 const std::string& content_type) { 49 const std::string& content_type) {
50 EXPECT_EQ(name, param.name); 50 EXPECT_EQ(name, param.name);
51 EXPECT_EQ(value, param.value); 51 EXPECT_EQ(value, param.value);
52 EXPECT_EQ(content_type, param.content_type); 52 EXPECT_EQ(content_type, param.content_type);
53 } 53 }
54 54
55 TEST_F(TemplateURLTest, Defaults) { 55 TEST_F(TemplateURLTest, Defaults) {
56 TemplateURLData data; 56 TemplateURLData data;
57 EXPECT_FALSE(data.show_in_default_list);
58 EXPECT_FALSE(data.safe_for_autoreplace); 57 EXPECT_FALSE(data.safe_for_autoreplace);
59 EXPECT_EQ(0, data.prepopulate_id); 58 EXPECT_EQ(0, data.prepopulate_id);
60 } 59 }
61 60
62 TEST_F(TemplateURLTest, TestValidWithComplete) { 61 TEST_F(TemplateURLTest, TestValidWithComplete) {
63 TemplateURLData data; 62 TemplateURLData data;
64 data.SetURL("{searchTerms}"); 63 data.SetURL("{searchTerms}");
65 TemplateURL url(data); 64 TemplateURL url(data);
66 EXPECT_TRUE(url.url_ref().IsValid(search_terms_data_)); 65 EXPECT_TRUE(url.url_ref().IsValid(search_terms_data_));
67 } 66 }
(...skipping 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after
1867 GURL("https://www.foo.org/search?q=Y+Z"), 1866 GURL("https://www.foo.org/search?q=Y+Z"),
1868 search_terms_data_, &search_terms)); 1867 search_terms_data_, &search_terms));
1869 EXPECT_EQ(base::ASCIIToUTF16("Y Z"), search_terms); 1868 EXPECT_EQ(base::ASCIIToUTF16("Y Z"), search_terms);
1870 EXPECT_TRUE(url.ExtractSearchTermsFromURL( 1869 EXPECT_TRUE(url.ExtractSearchTermsFromURL(
1871 GURL("https://www.foo.org/s#q=123"), 1870 GURL("https://www.foo.org/s#q=123"),
1872 search_terms_data_, &search_terms)); 1871 search_terms_data_, &search_terms));
1873 EXPECT_EQ(base::ASCIIToUTF16("123"), search_terms); 1872 EXPECT_EQ(base::ASCIIToUTF16("123"), search_terms);
1874 1873
1875 search_terms_data_.set_google_base_url("http://www.google.com/"); 1874 search_terms_data_.set_google_base_url("http://www.google.com/");
1876 } 1875 }
OLDNEW
« no previous file with comments | « components/search_engines/template_url_service.cc ('k') | components/sync/protocol/proto_visitors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698