| OLD | NEW | 
|   1 // Copyright 2015 The Chromium Authors. All rights reserved. |   1 // Copyright 2015 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_engines/desktop_search_win.h" |   5 #include "components/search_engines/desktop_search_win.h" | 
|   6  |   6  | 
 |   7 #include <stddef.h> | 
 |   8  | 
|   7 #include "base/macros.h" |   9 #include "base/macros.h" | 
|   8 #include "base/strings/string16.h" |  10 #include "base/strings/string16.h" | 
|   9 #include "components/search_engines/testing_search_terms_data.h" |  11 #include "components/search_engines/testing_search_terms_data.h" | 
|  10 #include "testing/gtest/include/gtest/gtest.h" |  12 #include "testing/gtest/include/gtest/gtest.h" | 
|  11 #include "url/gurl.h" |  13 #include "url/gurl.h" | 
|  12  |  14  | 
|  13 namespace { |  15 namespace { | 
|  14 struct DetectWindowsDesktopSearchTestData { |  16 struct DetectWindowsDesktopSearchTestData { | 
|  15   const char* url; |  17   const char* url; | 
|  16   const wchar_t* expected_search_terms; |  18   const wchar_t* expected_search_terms; | 
| (...skipping 19 matching lines...) Expand all  Loading... | 
|  36     TestingSearchTermsData search_terms_data("https://www.google.com"); |  38     TestingSearchTermsData search_terms_data("https://www.google.com"); | 
|  37     base::string16 search_terms; |  39     base::string16 search_terms; | 
|  38     bool is_desktop_search = DetectWindowsDesktopSearch( |  40     bool is_desktop_search = DetectWindowsDesktopSearch( | 
|  39         GURL(test_data[i].url), search_terms_data, &search_terms); |  41         GURL(test_data[i].url), search_terms_data, &search_terms); | 
|  40     const base::string16 expected_search_terms( |  42     const base::string16 expected_search_terms( | 
|  41         test_data[i].expected_search_terms); |  43         test_data[i].expected_search_terms); | 
|  42     EXPECT_EQ(!expected_search_terms.empty(), is_desktop_search); |  44     EXPECT_EQ(!expected_search_terms.empty(), is_desktop_search); | 
|  43     EXPECT_EQ(expected_search_terms, search_terms); |  45     EXPECT_EQ(expected_search_terms, search_terms); | 
|  44   } |  46   } | 
|  45 } |  47 } | 
| OLD | NEW |