| OLD | NEW |
| 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 <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 { | 334 { |
| 335 content::NotificationRegistrar registrar; | 335 content::NotificationRegistrar registrar; |
| 336 registrar.Add(this, chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, | 336 registrar.Add(this, chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, |
| 337 content::Source<Profile>(profile)); | 337 content::Source<Profile>(profile)); |
| 338 content::RunMessageLoop(); | 338 content::RunMessageLoop(); |
| 339 // We don't want to return until all observers have processed this | 339 // We don't want to return until all observers have processed this |
| 340 // notification, because some (e.g. the in-memory history database) may do | 340 // notification, because some (e.g. the in-memory history database) may do |
| 341 // something important. Since we don't know where in the observer list we | 341 // something important. Since we don't know where in the observer list we |
| 342 // stand, just spin the message loop once more to allow the current | 342 // stand, just spin the message loop once more to allow the current |
| 343 // callstack to complete. | 343 // callstack to complete. |
| 344 ui_test_utils::RunAllPendingInMessageLoop(); | 344 content::RunAllPendingInMessageLoop(); |
| 345 } | 345 } |
| 346 } | 346 } |
| 347 | 347 |
| 348 void SetupHistory() { | 348 void SetupHistory() { |
| 349 // Add enough history pages containing |kSearchText| to trigger | 349 // Add enough history pages containing |kSearchText| to trigger |
| 350 // open history page url in autocomplete result. | 350 // open history page url in autocomplete result. |
| 351 for (size_t i = 0; i < arraysize(kHistoryEntries); i++) { | 351 for (size_t i = 0; i < arraysize(kHistoryEntries); i++) { |
| 352 // Add everything in order of time. We don't want to have a time that | 352 // Add everything in order of time. We don't want to have a time that |
| 353 // is "right now" or it will nondeterministically appear in the results. | 353 // is "right now" or it will nondeterministically appear in the results. |
| 354 Time t = Time::Now() - TimeDelta::FromHours(i + 1); | 354 Time t = Time::Now() - TimeDelta::FromHours(i + 1); |
| (...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1669 | 1669 |
| 1670 // Middle-clicking shouldn't select all the text either. | 1670 // Middle-clicking shouldn't select all the text either. |
| 1671 ASSERT_NO_FATAL_FAILURE( | 1671 ASSERT_NO_FATAL_FAILURE( |
| 1672 ClickFocusViewOrigin(ui_controls::LEFT, kClickOffset, kClickOffset)); | 1672 ClickFocusViewOrigin(ui_controls::LEFT, kClickOffset, kClickOffset)); |
| 1673 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); | 1673 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); |
| 1674 ASSERT_NO_FATAL_FAILURE( | 1674 ASSERT_NO_FATAL_FAILURE( |
| 1675 ClickFocusViewOrigin(ui_controls::MIDDLE, kClickOffset, kClickOffset)); | 1675 ClickFocusViewOrigin(ui_controls::MIDDLE, kClickOffset, kClickOffset)); |
| 1676 EXPECT_FALSE(omnibox_view->IsSelectAll()); | 1676 EXPECT_FALSE(omnibox_view->IsSelectAll()); |
| 1677 } | 1677 } |
| 1678 #endif // defined(USE_AURA) | 1678 #endif // defined(USE_AURA) |
| OLD | NEW |