OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/search/instant_search_prerenderer.h" | 5 #include "chrome/browser/ui/search/instant_search_prerenderer.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 GURL url("https://www.google.com/url?bar=foo&aqs=chrome...0&ie=utf-8&oq=f"); | 522 GURL url("https://www.google.com/url?bar=foo&aqs=chrome...0&ie=utf-8&oq=f"); |
523 browser()->instant_controller()->OpenInstant(CURRENT_TAB, url); | 523 browser()->instant_controller()->OpenInstant(CURRENT_TAB, url); |
524 content::MockRenderProcessHost* process = | 524 content::MockRenderProcessHost* process = |
525 static_cast<content::MockRenderProcessHost*>( | 525 static_cast<content::MockRenderProcessHost*>( |
526 prerender_contents()->GetRenderViewHost()->GetProcess()); | 526 prerender_contents()->GetRenderViewHost()->GetProcess()); |
527 const IPC::Message* message = process->sink().GetFirstMessageMatching( | 527 const IPC::Message* message = process->sink().GetFirstMessageMatching( |
528 ChromeViewMsg_SearchBoxSubmit::ID); | 528 ChromeViewMsg_SearchBoxSubmit::ID); |
529 ASSERT_TRUE(message); | 529 ASSERT_TRUE(message); |
530 | 530 |
531 // Verify the IPC message params. | 531 // Verify the IPC message params. |
532 Tuple<base::string16, EmbeddedSearchRequestParams> params; | 532 base::Tuple<base::string16, EmbeddedSearchRequestParams> params; |
533 ChromeViewMsg_SearchBoxSubmit::Read(message, ¶ms); | 533 ChromeViewMsg_SearchBoxSubmit::Read(message, ¶ms); |
534 EXPECT_EQ("foo", base::UTF16ToASCII(get<0>(params))); | 534 EXPECT_EQ("foo", base::UTF16ToASCII(base::get<0>(params))); |
535 EXPECT_EQ("f", base::UTF16ToASCII(get<1>(params).original_query)); | 535 EXPECT_EQ("f", base::UTF16ToASCII(base::get<1>(params).original_query)); |
536 EXPECT_EQ("utf-8", base::UTF16ToASCII(get<1>(params).input_encoding)); | 536 EXPECT_EQ("utf-8", base::UTF16ToASCII(base::get<1>(params).input_encoding)); |
537 EXPECT_EQ("", base::UTF16ToASCII(get<1>(params).rlz_parameter_value)); | 537 EXPECT_EQ("", base::UTF16ToASCII(base::get<1>(params).rlz_parameter_value)); |
538 EXPECT_EQ("chrome...0", | 538 EXPECT_EQ("chrome...0", |
539 base::UTF16ToASCII(get<1>(params).assisted_query_stats)); | 539 base::UTF16ToASCII(base::get<1>(params).assisted_query_stats)); |
540 } | 540 } |
541 #endif | 541 #endif |
OLD | NEW |