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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_browsertest.cc

Issue 8572027: Deflake AutocompleteBrowserTest.FocusSearch test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/format_macros.h" 5 #include "base/format_macros.h"
6 #include "base/path_service.h" 6 #include "base/path_service.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.h" 9 #include "chrome/browser/autocomplete/autocomplete.h"
10 #include "chrome/browser/autocomplete/autocomplete_edit.h" 10 #include "chrome/browser/autocomplete/autocomplete_edit.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 content::PAGE_TRANSITION_START_PAGE); 158 content::PAGE_TRANSITION_START_PAGE);
159 observer.Wait(); 159 observer.Wait();
160 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), 160 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL),
161 location_bar->location_entry()->GetText()); 161 location_bar->location_entry()->GetText());
162 browser()->CloseTab(); 162 browser()->CloseTab();
163 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), 163 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL),
164 location_bar->location_entry()->GetText()); 164 location_bar->location_entry()->GetText());
165 EXPECT_TRUE(location_bar->location_entry()->IsSelectAll()); 165 EXPECT_TRUE(location_bar->location_entry()->IsSelectAll());
166 } 166 }
167 167
168 #if defined(OS_WIN) || defined(OS_LINUX) 168 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, FocusSearch) {
169 // http://crbug.com/104307
170 #define MAYBE_FocusSearch FLAKY_FocusSearch
171 #else
172 #define MAYBE_FocusSearch FocusSearch
173 #endif
174 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, MAYBE_FocusSearch) {
175 LocationBar* location_bar = GetLocationBar(); 169 LocationBar* location_bar = GetLocationBar();
176 170
177 // Focus search when omnibox is blank 171 // Focus search when omnibox is blank
178 { 172 {
179 EXPECT_TRUE(location_bar->GetInputString().empty()); 173 EXPECT_TRUE(location_bar->GetInputString().empty());
180 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), 174 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL),
181 location_bar->location_entry()->GetText()); 175 location_bar->location_entry()->GetText());
182 176
183 location_bar->FocusSearch(); 177 location_bar->FocusSearch();
184 EXPECT_TRUE(location_bar->GetInputString().empty()); 178 EXPECT_TRUE(location_bar->GetInputString().empty());
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 const AutocompleteResult& result = autocomplete_controller->result(); 315 const AutocompleteResult& result = autocomplete_controller->result();
322 // 'App test' is also a substring of extension 'Packaged App Test'. 316 // 'App test' is also a substring of extension 'Packaged App Test'.
323 EXPECT_GT(result.size(), 2U) << AutocompleteResultAsString(result); 317 EXPECT_GT(result.size(), 2U) << AutocompleteResultAsString(result);
324 AutocompleteMatch match = result.match_at(0); 318 AutocompleteMatch match = result.match_at(0);
325 EXPECT_EQ(ASCIIToUTF16("App Test"), match.contents); 319 EXPECT_EQ(ASCIIToUTF16("App Test"), match.contents);
326 EXPECT_EQ(AutocompleteMatch::EXTENSION_APP, match.type); 320 EXPECT_EQ(AutocompleteMatch::EXTENSION_APP, match.type);
327 EXPECT_FALSE(match.deletable); 321 EXPECT_FALSE(match.deletable);
328 location_bar->AcceptInput(); 322 location_bar->AcceptInput();
329 } 323 }
330 } 324 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698