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.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.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 bookmark_utils::AddIfNotBookmarked(bookmark_model, |
84 bookmark_model, GURL(kPersistBookmarkURL), | 84 bookmark_model, |
85 base::ASCIIToUTF16(kPersistBookmarkTitle)); | 85 GURL(kPersistBookmarkURL), |
| 86 base::ASCIIToUTF16(kPersistBookmarkTitle)); |
86 } | 87 } |
87 | 88 |
88 #if defined(THREAD_SANITIZER) | 89 #if defined(THREAD_SANITIZER) |
89 // BookmarkBrowsertest.Persist fails under ThreadSanitizer on Linux, see | 90 // BookmarkBrowsertest.Persist fails under ThreadSanitizer on Linux, see |
90 // http://crbug.com/340223. | 91 // http://crbug.com/340223. |
91 #define MAYBE_Persist DISABLED_Persist | 92 #define MAYBE_Persist DISABLED_Persist |
92 #else | 93 #else |
93 #define MAYBE_Persist Persist | 94 #define MAYBE_Persist Persist |
94 #endif | 95 #endif |
95 IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, MAYBE_Persist) { | 96 IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, MAYBE_Persist) { |
(...skipping 17 matching lines...) Expand all Loading... |
113 | 114 |
114 BookmarkModel* bookmark_model1 = WaitForBookmarkModel(browser()->profile()); | 115 BookmarkModel* bookmark_model1 = WaitForBookmarkModel(browser()->profile()); |
115 | 116 |
116 ui_test_utils::BrowserAddedObserver observer; | 117 ui_test_utils::BrowserAddedObserver observer; |
117 g_browser_process->profile_manager()->CreateMultiProfileAsync( | 118 g_browser_process->profile_manager()->CreateMultiProfileAsync( |
118 base::string16(), base::string16(), ProfileManager::CreateCallback(), | 119 base::string16(), base::string16(), ProfileManager::CreateCallback(), |
119 std::string()); | 120 std::string()); |
120 Browser* browser2 = observer.WaitForSingleNewBrowser(); | 121 Browser* browser2 = observer.WaitForSingleNewBrowser(); |
121 BookmarkModel* bookmark_model2 = WaitForBookmarkModel(browser2->profile()); | 122 BookmarkModel* bookmark_model2 = WaitForBookmarkModel(browser2->profile()); |
122 | 123 |
123 bookmark_utils::AddIfNotBookmarked( | 124 bookmark_utils::AddIfNotBookmarked(bookmark_model1, |
124 bookmark_model1, GURL(kPersistBookmarkURL), | 125 bookmark_model1, |
125 base::ASCIIToUTF16(kPersistBookmarkTitle)); | 126 GURL(kPersistBookmarkURL), |
| 127 base::ASCIIToUTF16(kPersistBookmarkTitle)); |
126 std::vector<BookmarkService::URLAndTitle> urls1, urls2; | 128 std::vector<BookmarkService::URLAndTitle> urls1, urls2; |
127 bookmark_model1->GetBookmarks(&urls1); | 129 bookmark_model1->GetBookmarks(&urls1); |
128 bookmark_model2->GetBookmarks(&urls2); | 130 bookmark_model2->GetBookmarks(&urls2); |
129 ASSERT_EQ(1u, urls1.size()); | 131 ASSERT_EQ(1u, urls1.size()); |
130 ASSERT_TRUE(urls2.empty()); | 132 ASSERT_TRUE(urls2.empty()); |
131 } | 133 } |
132 | 134 |
133 #endif | 135 #endif |
OLD | NEW |