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

Side by Side Diff: chrome/browser/instant/instant_browsertest.cc

Issue 10537154: A working implementation of AQS (Assisted Query Stats). (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Addressed comments and added more docs. Created 8 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/importer/profile_writer.cc ('k') | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/string_util.h" 6 #include "base/string_util.h"
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/autocomplete/autocomplete_edit.h" 9 #include "chrome/browser/autocomplete/autocomplete_edit.h"
10 #include "chrome/browser/content_settings/host_content_settings_map.h" 10 #include "chrome/browser/content_settings/host_content_settings_map.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 EXPECT_TRUE(instant()->is_displayable()); 282 EXPECT_TRUE(instant()->is_displayable());
283 EXPECT_TRUE(instant()->IsCurrent()); 283 EXPECT_TRUE(instant()->IsCurrent());
284 EXPECT_EQ("defghi", UTF16ToUTF8(omnibox()->GetText())); 284 EXPECT_EQ("defghi", UTF16ToUTF8(omnibox()->GetText()));
285 285
286 // Make sure the URL that will get committed when we press <Enter> matches 286 // Make sure the URL that will get committed when we press <Enter> matches
287 // that of the default search provider. 287 // that of the default search provider.
288 const TemplateURL* default_turl = 288 const TemplateURL* default_turl =
289 TemplateURLServiceFactory::GetForProfile(browser()->profile())-> 289 TemplateURLServiceFactory::GetForProfile(browser()->profile())->
290 GetDefaultSearchProvider(); 290 GetDefaultSearchProvider();
291 EXPECT_TRUE(default_turl); 291 EXPECT_TRUE(default_turl);
292 EXPECT_EQ(default_turl->url_ref().ReplaceSearchTerms(ASCIIToUTF16("defghi"), 292 EXPECT_EQ(default_turl->url_ref().ReplaceSearchTerms(
293 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16()), 293 TemplateURLRef::SearchTermsArgs(ASCIIToUTF16("defghi"))),
294 loader()->url().spec()); 294 loader()->url().spec());
295 295
296 // Check that the value is reflected and onchange is called. 296 // Check that the value is reflected and onchange is called.
297 EXPECT_EQ("true 0 0 1 true d false def false 3 3", 297 EXPECT_EQ("true 0 0 1 true d false def false 3 3",
298 GetSearchStateAsString(preview()->web_contents(), false)); 298 GetSearchStateAsString(preview()->web_contents(), false));
299 } 299 }
300 300
301 // Verify that the onsubmit event is dispatched upon pressing <Enter>. 301 // Verify that the onsubmit event is dispatched upon pressing <Enter>.
302 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(OnSubmitEvent)) { 302 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(OnSubmitEvent)) {
303 ASSERT_TRUE(test_server()->Start()); 303 ASSERT_TRUE(test_server()->Start());
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 DetermineInstantSupport(); 835 DetermineInstantSupport();
836 SearchAndWaitForPreviewToShow(); 836 SearchAndWaitForPreviewToShow();
837 837
838 // Now there should be three rows, the third being the instant preview. 838 // Now there should be three rows, the third being the instant preview.
839 TaskManagerBrowserTestUtil::WaitForResourceChange(3); 839 TaskManagerBrowserTestUtil::WaitForResourceChange(3);
840 string16 prefix = l10n_util::GetStringFUTF16( 840 string16 prefix = l10n_util::GetStringFUTF16(
841 IDS_TASK_MANAGER_INSTANT_PREVIEW_PREFIX, string16()); 841 IDS_TASK_MANAGER_INSTANT_PREVIEW_PREFIX, string16());
842 string16 title = task_manager->GetResourceTitle(2); 842 string16 title = task_manager->GetResourceTitle(2);
843 EXPECT_TRUE(StartsWith(title, prefix, true)) << title << " vs " << prefix; 843 EXPECT_TRUE(StartsWith(title, prefix, true)) << title << " vs " << prefix;
844 } 844 }
OLDNEW
« no previous file with comments | « chrome/browser/importer/profile_writer.cc ('k') | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698