Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: chrome/browser/bookmarks/bookmark_browsertest.cc

Issue 10967003: Add desktop type context to most existing instances of FindTabbedBrowser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moving check_deps exception to specific_include_rules after chat with Kai. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "chrome/browser/bookmarks/bookmark_utils.h" 11 #include "chrome/browser/bookmarks/bookmark_utils.h"
12 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/profiles/profile_manager.h" 14 #include "chrome/browser/profiles/profile_manager.h"
15 #include "chrome/browser/ui/browser.h" 15 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/browser_commands.h" 16 #include "chrome/browser/ui/browser_commands.h"
17 #include "chrome/browser/ui/browser_window.h" 17 #include "chrome/browser/ui/browser_window.h"
18 #include "chrome/browser/ui/host_desktop.h"
18 #include "chrome/common/chrome_notification_types.h" 19 #include "chrome/common/chrome_notification_types.h"
19 #include "chrome/test/base/in_process_browser_test.h" 20 #include "chrome/test/base/in_process_browser_test.h"
20 #include "chrome/test/base/ui_test_utils.h" 21 #include "chrome/test/base/ui_test_utils.h"
21 #include "content/public/browser/notification_service.h" 22 #include "content/public/browser/notification_service.h"
22 #include "content/public/test/browser_test_utils.h" 23 #include "content/public/test/browser_test_utils.h"
23 24
24 namespace { 25 namespace {
25 const char kPersistBookmarkURL[] = "http://www.cnn.com/"; 26 const char kPersistBookmarkURL[] = "http://www.cnn.com/";
26 const char kPersistBookmarkTitle[] = "CNN"; 27 const char kPersistBookmarkTitle[] = "CNN";
27 } 28 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 104
104 // Sanity check that bookmarks from different profiles are separate. 105 // Sanity check that bookmarks from different profiles are separate.
105 IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, MultiProfile) { 106 IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, MultiProfile) {
106 ScopedTempDir temp_dir; 107 ScopedTempDir temp_dir;
107 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 108 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
108 109
109 BookmarkModel* bookmark_model1 = WaitForBookmarkModel(browser()->profile()); 110 BookmarkModel* bookmark_model1 = WaitForBookmarkModel(browser()->profile());
110 111
111 ui_test_utils::BrowserAddedObserver observer; 112 ui_test_utils::BrowserAddedObserver observer;
112 g_browser_process->profile_manager()->CreateMultiProfileAsync( 113 g_browser_process->profile_manager()->CreateMultiProfileAsync(
113 string16(), string16(), ProfileManager::CreateCallback()); 114 string16(), string16(), ProfileManager::CreateCallback(),
115 chrome::HOST_DESKTOP_TYPE_NATIVE);
114 Browser* browser2 = observer.WaitForSingleNewBrowser(); 116 Browser* browser2 = observer.WaitForSingleNewBrowser();
115 BookmarkModel* bookmark_model2 = WaitForBookmarkModel(browser2->profile()); 117 BookmarkModel* bookmark_model2 = WaitForBookmarkModel(browser2->profile());
116 118
117 bookmark_utils::AddIfNotBookmarked( 119 bookmark_utils::AddIfNotBookmarked(
118 bookmark_model1, GURL(kPersistBookmarkURL), 120 bookmark_model1, GURL(kPersistBookmarkURL),
119 ASCIIToUTF16(kPersistBookmarkTitle)); 121 ASCIIToUTF16(kPersistBookmarkTitle));
120 std::vector<BookmarkService::URLAndTitle> urls1, urls2; 122 std::vector<BookmarkService::URLAndTitle> urls1, urls2;
121 bookmark_model1->GetBookmarks(&urls1); 123 bookmark_model1->GetBookmarks(&urls1);
122 bookmark_model2->GetBookmarks(&urls2); 124 bookmark_model2->GetBookmarks(&urls2);
123 ASSERT_EQ(1u, urls1.size()); 125 ASSERT_EQ(1u, urls1.size());
124 ASSERT_TRUE(urls2.empty()); 126 ASSERT_TRUE(urls2.empty());
125 } 127 }
126 128
127 #endif 129 #endif
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/DEPS ('k') | chrome/browser/captive_portal/captive_portal_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698