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