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/timer.h" | 6 #include "base/timer.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 ASSERT_EQ(1u, urls.size()); | 98 ASSERT_EQ(1u, urls.size()); |
99 ASSERT_EQ(GURL(kPersistBookmarkURL), urls[0].url); | 99 ASSERT_EQ(GURL(kPersistBookmarkURL), urls[0].url); |
100 ASSERT_EQ(ASCIIToUTF16(kPersistBookmarkTitle), urls[0].title); | 100 ASSERT_EQ(ASCIIToUTF16(kPersistBookmarkTitle), urls[0].title); |
101 } | 101 } |
102 | 102 |
103 #if !defined(OS_CHROMEOS) // No multi-profile on ChromeOS. | 103 #if !defined(OS_CHROMEOS) // No multi-profile on ChromeOS. |
104 | 104 |
105 // Sanity check that bookmarks from different profiles are separate. | 105 // Sanity check that bookmarks from different profiles are separate. |
106 // DISABLED_ because it regularly times out: http://crbug.com/159002. | 106 // DISABLED_ because it regularly times out: http://crbug.com/159002. |
107 IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, DISABLED_MultiProfile) { | 107 IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, DISABLED_MultiProfile) { |
108 ScopedTempDir temp_dir; | 108 base::ScopedTempDir temp_dir; |
109 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 109 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
110 | 110 |
111 BookmarkModel* bookmark_model1 = WaitForBookmarkModel(browser()->profile()); | 111 BookmarkModel* bookmark_model1 = WaitForBookmarkModel(browser()->profile()); |
112 | 112 |
113 ui_test_utils::BrowserAddedObserver observer; | 113 ui_test_utils::BrowserAddedObserver observer; |
114 g_browser_process->profile_manager()->CreateMultiProfileAsync( | 114 g_browser_process->profile_manager()->CreateMultiProfileAsync( |
115 string16(), string16(), ProfileManager::CreateCallback(), | 115 string16(), string16(), ProfileManager::CreateCallback(), |
116 chrome::HOST_DESKTOP_TYPE_NATIVE); | 116 chrome::HOST_DESKTOP_TYPE_NATIVE); |
117 Browser* browser2 = observer.WaitForSingleNewBrowser(); | 117 Browser* browser2 = observer.WaitForSingleNewBrowser(); |
118 BookmarkModel* bookmark_model2 = WaitForBookmarkModel(browser2->profile()); | 118 BookmarkModel* bookmark_model2 = WaitForBookmarkModel(browser2->profile()); |
119 | 119 |
120 bookmark_utils::AddIfNotBookmarked( | 120 bookmark_utils::AddIfNotBookmarked( |
121 bookmark_model1, GURL(kPersistBookmarkURL), | 121 bookmark_model1, GURL(kPersistBookmarkURL), |
122 ASCIIToUTF16(kPersistBookmarkTitle)); | 122 ASCIIToUTF16(kPersistBookmarkTitle)); |
123 std::vector<BookmarkService::URLAndTitle> urls1, urls2; | 123 std::vector<BookmarkService::URLAndTitle> urls1, urls2; |
124 bookmark_model1->GetBookmarks(&urls1); | 124 bookmark_model1->GetBookmarks(&urls1); |
125 bookmark_model2->GetBookmarks(&urls2); | 125 bookmark_model2->GetBookmarks(&urls2); |
126 ASSERT_EQ(1u, urls1.size()); | 126 ASSERT_EQ(1u, urls1.size()); |
127 ASSERT_TRUE(urls2.empty()); | 127 ASSERT_TRUE(urls2.empty()); |
128 } | 128 } |
129 | 129 |
130 #endif | 130 #endif |
OLD | NEW |