| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 test::WaitForBookmarkModelToLoad(bookmark_model); | 285 test::WaitForBookmarkModelToLoad(bookmark_model); |
| 286 | 286 |
| 287 GURL url(entry.url); | 287 GURL url(entry.url); |
| 288 // Add everything in order of time. We don't want to have a time that | 288 // Add everything in order of time. We don't want to have a time that |
| 289 // is "right now" or it will nondeterministically appear in the results. | 289 // is "right now" or it will nondeterministically appear in the results. |
| 290 history_service->AddPageWithDetails(url, base::UTF8ToUTF16(entry.title), | 290 history_service->AddPageWithDetails(url, base::UTF8ToUTF16(entry.title), |
| 291 entry.visit_count, | 291 entry.visit_count, |
| 292 entry.typed_count, time, false, | 292 entry.typed_count, time, false, |
| 293 history::SOURCE_BROWSED); | 293 history::SOURCE_BROWSED); |
| 294 if (entry.starred) | 294 if (entry.starred) |
| 295 bookmark_utils::AddIfNotBookmarked(bookmark_model, url, base::string16()); | 295 bookmarks::AddIfNotBookmarked(bookmark_model, url, base::string16()); |
| 296 // Wait at least for the AddPageWithDetails() call to finish. | 296 // Wait at least for the AddPageWithDetails() call to finish. |
| 297 { | 297 { |
| 298 content::NotificationRegistrar registrar; | 298 content::NotificationRegistrar registrar; |
| 299 registrar.Add(this, chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, | 299 registrar.Add(this, chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, |
| 300 content::Source<Profile>(profile)); | 300 content::Source<Profile>(profile)); |
| 301 content::RunMessageLoop(); | 301 content::RunMessageLoop(); |
| 302 // We don't want to return until all observers have processed this | 302 // We don't want to return until all observers have processed this |
| 303 // notification, because some (e.g. the in-memory history database) may do | 303 // notification, because some (e.g. the in-memory history database) may do |
| 304 // something important. Since we don't know where in the observer list we | 304 // something important. Since we don't know where in the observer list we |
| 305 // stand, just spin the message loop once more to allow the current | 305 // stand, just spin the message loop once more to allow the current |
| (...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1786 omnibox_view->Update(); | 1786 omnibox_view->Update(); |
| 1787 EXPECT_EQ(url_c, omnibox_view->GetText()); | 1787 EXPECT_EQ(url_c, omnibox_view->GetText()); |
| 1788 } | 1788 } |
| 1789 | 1789 |
| 1790 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, EscDisablesSearchTermReplacement) { | 1790 IN_PROC_BROWSER_TEST_F(OmniboxViewTest, EscDisablesSearchTermReplacement) { |
| 1791 browser()->toolbar_model()->set_url_replacement_enabled(true); | 1791 browser()->toolbar_model()->set_url_replacement_enabled(true); |
| 1792 chrome::FocusLocationBar(browser()); | 1792 chrome::FocusLocationBar(browser()); |
| 1793 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_ESCAPE, 0)); | 1793 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_ESCAPE, 0)); |
| 1794 EXPECT_FALSE(browser()->toolbar_model()->url_replacement_enabled()); | 1794 EXPECT_FALSE(browser()->toolbar_model()->url_replacement_enabled()); |
| 1795 } | 1795 } |
| OLD | NEW |