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/message_loop.h" | 7 #include "base/message_loop/message_loop.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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 ASSERT_TRUE(bookmark_model); | 313 ASSERT_TRUE(bookmark_model); |
314 ui_test_utils::WaitForBookmarkModelToLoad(bookmark_model); | 314 ui_test_utils::WaitForBookmarkModelToLoad(bookmark_model); |
315 | 315 |
316 GURL url(entry.url); | 316 GURL url(entry.url); |
317 // Add everything in order of time. We don't want to have a time that | 317 // Add everything in order of time. We don't want to have a time that |
318 // is "right now" or it will nondeterministically appear in the results. | 318 // is "right now" or it will nondeterministically appear in the results. |
319 history_service->AddPageWithDetails(url, UTF8ToUTF16(entry.title), | 319 history_service->AddPageWithDetails(url, UTF8ToUTF16(entry.title), |
320 entry.visit_count, | 320 entry.visit_count, |
321 entry.typed_count, time, false, | 321 entry.typed_count, time, false, |
322 history::SOURCE_BROWSED); | 322 history::SOURCE_BROWSED); |
| 323 history_service->SetPageContents(url, UTF8ToUTF16(entry.body)); |
323 if (entry.starred) | 324 if (entry.starred) |
324 bookmark_utils::AddIfNotBookmarked(bookmark_model, url, string16()); | 325 bookmark_utils::AddIfNotBookmarked(bookmark_model, url, string16()); |
325 // Wait at least for the AddPageWithDetails() call to finish. | 326 // Wait at least for the AddPageWithDetails() call to finish. |
326 { | 327 { |
327 content::NotificationRegistrar registrar; | 328 content::NotificationRegistrar registrar; |
328 registrar.Add(this, chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, | 329 registrar.Add(this, chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, |
329 content::Source<Profile>(profile)); | 330 content::Source<Profile>(profile)); |
330 content::RunMessageLoop(); | 331 content::RunMessageLoop(); |
331 // We don't want to return until all observers have processed this | 332 // We don't want to return until all observers have processed this |
332 // notification, because some (e.g. the in-memory history database) may do | 333 // notification, because some (e.g. the in-memory history database) may do |
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1839 ASSERT_EQ(5U, end); | 1840 ASSERT_EQ(5U, end); |
1840 | 1841 |
1841 ui_test_utils::ClickOnView(browser(), VIEW_ID_TAB_CONTAINER); | 1842 ui_test_utils::ClickOnView(browser(), VIEW_ID_TAB_CONTAINER); |
1842 ASSERT_FALSE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); | 1843 ASSERT_FALSE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); |
1843 | 1844 |
1844 omnibox_view->GetSelectionBounds(&start, &end); | 1845 omnibox_view->GetSelectionBounds(&start, &end); |
1845 ASSERT_EQ(0U, start); | 1846 ASSERT_EQ(0U, start); |
1846 ASSERT_EQ(0U, end); | 1847 ASSERT_EQ(0U, end); |
1847 } | 1848 } |
1848 #endif // !defined(TOOLKIT_GTK) | 1849 #endif // !defined(TOOLKIT_GTK) |
OLD | NEW |