| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdio.h> | 6 #include <stdio.h> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 HistoryServiceFactory::GetForProfile( | 299 HistoryServiceFactory::GetForProfile( |
| 300 profile, ServiceAccessType::EXPLICIT_ACCESS); | 300 profile, ServiceAccessType::EXPLICIT_ACCESS); |
| 301 ASSERT_TRUE(history_service); | 301 ASSERT_TRUE(history_service); |
| 302 | 302 |
| 303 if (!history_service->BackendLoaded()) { | 303 if (!history_service->BackendLoaded()) { |
| 304 observer_.Add(history_service); | 304 observer_.Add(history_service); |
| 305 content::RunMessageLoop(); | 305 content::RunMessageLoop(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 BookmarkModel* bookmark_model = | 308 BookmarkModel* bookmark_model = |
| 309 BookmarkModelFactory::GetForProfile(profile); | 309 BookmarkModelFactory::GetForBrowserContext(profile); |
| 310 ASSERT_TRUE(bookmark_model); | 310 ASSERT_TRUE(bookmark_model); |
| 311 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model); | 311 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model); |
| 312 | 312 |
| 313 GURL url(entry.url); | 313 GURL url(entry.url); |
| 314 // Add everything in order of time. We don't want to have a time that | 314 // Add everything in order of time. We don't want to have a time that |
| 315 // is "right now" or it will nondeterministically appear in the results. | 315 // is "right now" or it will nondeterministically appear in the results. |
| 316 history_service->AddPageWithDetails(url, base::UTF8ToUTF16(entry.title), | 316 history_service->AddPageWithDetails(url, base::UTF8ToUTF16(entry.title), |
| 317 entry.visit_count, | 317 entry.visit_count, |
| 318 entry.typed_count, time, false, | 318 entry.typed_count, time, false, |
| 319 history::SOURCE_BROWSED); | 319 history::SOURCE_BROWSED); |
| (...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1988 | 1988 |
| 1989 // Now Shift+Right should do nothing, and Shift+Left should reduce. | 1989 // Now Shift+Right should do nothing, and Shift+Left should reduce. |
| 1990 // At the end, so Shift+Right should do nothing. | 1990 // At the end, so Shift+Right should do nothing. |
| 1991 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_RIGHT, ui::EF_SHIFT_DOWN)); | 1991 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_RIGHT, ui::EF_SHIFT_DOWN)); |
| 1992 EXPECT_EQ(2u, GetSelectionSize(omnibox_view)); | 1992 EXPECT_EQ(2u, GetSelectionSize(omnibox_view)); |
| 1993 | 1993 |
| 1994 // And Left should reduce by one character. | 1994 // And Left should reduce by one character. |
| 1995 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_LEFT, ui::EF_SHIFT_DOWN)); | 1995 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_LEFT, ui::EF_SHIFT_DOWN)); |
| 1996 EXPECT_EQ(1u, GetSelectionSize(omnibox_view)); | 1996 EXPECT_EQ(1u, GetSelectionSize(omnibox_view)); |
| 1997 } | 1997 } |
| OLD | NEW |