| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "base/timer/timer.h" | 7 #include "base/timer/timer.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 chrome::ExecuteCommand(browser(), IDC_SHOW_BOOKMARK_BAR); | 73 chrome::ExecuteCommand(browser(), IDC_SHOW_BOOKMARK_BAR); |
| 74 delay = WaitForBookmarkBarAnimationToFinish(); | 74 delay = WaitForBookmarkBarAnimationToFinish(); |
| 75 LOG(INFO) << "Took " << delay.InMilliseconds() << " ms to hide bookmark bar"; | 75 LOG(INFO) << "Took " << delay.InMilliseconds() << " ms to hide bookmark bar"; |
| 76 ASSERT_FALSE(IsVisible()); | 76 ASSERT_FALSE(IsVisible()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 // Verify that bookmarks persist browser restart. | 79 // Verify that bookmarks persist browser restart. |
| 80 IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, PRE_Persist) { | 80 IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, PRE_Persist) { |
| 81 BookmarkModel* bookmark_model = WaitForBookmarkModel(browser()->profile()); | 81 BookmarkModel* bookmark_model = WaitForBookmarkModel(browser()->profile()); |
| 82 | 82 |
| 83 bookmark_utils::AddIfNotBookmarked( | 83 bookmarks::AddIfNotBookmarked(bookmark_model, |
| 84 bookmark_model, GURL(kPersistBookmarkURL), | 84 GURL(kPersistBookmarkURL), |
| 85 base::ASCIIToUTF16(kPersistBookmarkTitle)); | 85 base::ASCIIToUTF16(kPersistBookmarkTitle)); |
| 86 } | 86 } |
| 87 | 87 |
| 88 #if defined(THREAD_SANITIZER) | 88 #if defined(THREAD_SANITIZER) |
| 89 // BookmarkBrowsertest.Persist fails under ThreadSanitizer on Linux, see | 89 // BookmarkBrowsertest.Persist fails under ThreadSanitizer on Linux, see |
| 90 // http://crbug.com/340223. | 90 // http://crbug.com/340223. |
| 91 #define MAYBE_Persist DISABLED_Persist | 91 #define MAYBE_Persist DISABLED_Persist |
| 92 #else | 92 #else |
| 93 #define MAYBE_Persist Persist | 93 #define MAYBE_Persist Persist |
| 94 #endif | 94 #endif |
| 95 IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, MAYBE_Persist) { | 95 IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, MAYBE_Persist) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 113 | 113 |
| 114 BookmarkModel* bookmark_model1 = WaitForBookmarkModel(browser()->profile()); | 114 BookmarkModel* bookmark_model1 = WaitForBookmarkModel(browser()->profile()); |
| 115 | 115 |
| 116 ui_test_utils::BrowserAddedObserver observer; | 116 ui_test_utils::BrowserAddedObserver observer; |
| 117 g_browser_process->profile_manager()->CreateMultiProfileAsync( | 117 g_browser_process->profile_manager()->CreateMultiProfileAsync( |
| 118 base::string16(), base::string16(), ProfileManager::CreateCallback(), | 118 base::string16(), base::string16(), ProfileManager::CreateCallback(), |
| 119 std::string()); | 119 std::string()); |
| 120 Browser* browser2 = observer.WaitForSingleNewBrowser(); | 120 Browser* browser2 = observer.WaitForSingleNewBrowser(); |
| 121 BookmarkModel* bookmark_model2 = WaitForBookmarkModel(browser2->profile()); | 121 BookmarkModel* bookmark_model2 = WaitForBookmarkModel(browser2->profile()); |
| 122 | 122 |
| 123 bookmark_utils::AddIfNotBookmarked( | 123 bookmarks::AddIfNotBookmarked(bookmark_model1, |
| 124 bookmark_model1, GURL(kPersistBookmarkURL), | 124 GURL(kPersistBookmarkURL), |
| 125 base::ASCIIToUTF16(kPersistBookmarkTitle)); | 125 base::ASCIIToUTF16(kPersistBookmarkTitle)); |
| 126 std::vector<BookmarkModel::URLAndTitle> urls1, urls2; | 126 std::vector<BookmarkModel::URLAndTitle> urls1, urls2; |
| 127 bookmark_model1->GetBookmarks(&urls1); | 127 bookmark_model1->GetBookmarks(&urls1); |
| 128 bookmark_model2->GetBookmarks(&urls2); | 128 bookmark_model2->GetBookmarks(&urls2); |
| 129 ASSERT_EQ(1u, urls1.size()); | 129 ASSERT_EQ(1u, urls1.size()); |
| 130 ASSERT_TRUE(urls2.empty()); | 130 ASSERT_TRUE(urls2.empty()); |
| 131 } | 131 } |
| 132 | 132 |
| 133 #endif | 133 #endif |
| OLD | NEW |