OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/api/sessions/sessions_api.h" | 5 #include "chrome/browser/extensions/api/sessions/sessions_api.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chrome/browser/extensions/api/tabs/tabs_api.h" | 10 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 CreateTestProfileSyncService(); | 97 CreateTestProfileSyncService(); |
98 CreateTestExtension(); | 98 CreateTestExtension(); |
99 } | 99 } |
100 | 100 |
101 void ExtensionSessionsTest::CreateTestProfileSyncService() { | 101 void ExtensionSessionsTest::CreateTestProfileSyncService() { |
102 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 102 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
103 base::FilePath path; | 103 base::FilePath path; |
104 PathService::Get(chrome::DIR_USER_DATA, &path); | 104 PathService::Get(chrome::DIR_USER_DATA, &path); |
105 path = path.AppendASCII("test_profile"); | 105 path = path.AppendASCII("test_profile"); |
106 if (!base::PathExists(path)) | 106 if (!base::PathExists(path)) |
107 CHECK(file_util::CreateDirectory(path)); | 107 CHECK(base::CreateDirectory(path)); |
108 Profile* profile = | 108 Profile* profile = |
109 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); | 109 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); |
110 profile_manager->RegisterTestingProfile(profile, true, false); | 110 profile_manager->RegisterTestingProfile(profile, true, false); |
111 browser_ = new Browser(Browser::CreateParams( | 111 browser_ = new Browser(Browser::CreateParams( |
112 profile, chrome::HOST_DESKTOP_TYPE_NATIVE)); | 112 profile, chrome::HOST_DESKTOP_TYPE_NATIVE)); |
113 ProfileSyncServiceMock* service = static_cast<ProfileSyncServiceMock*>( | 113 ProfileSyncServiceMock* service = static_cast<ProfileSyncServiceMock*>( |
114 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 114 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
115 profile, &ProfileSyncServiceMock::BuildMockProfileSyncService)); | 115 profile, &ProfileSyncServiceMock::BuildMockProfileSyncService)); |
116 | 116 |
117 associator_ = new browser_sync::SessionModelAssociator( | 117 associator_ = new browser_sync::SessionModelAssociator( |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 277 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
278 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 278 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) |
279 return; | 279 return; |
280 #endif | 280 #endif |
281 | 281 |
282 ASSERT_TRUE(RunExtensionSubtest("sessions", | 282 ASSERT_TRUE(RunExtensionSubtest("sessions", |
283 "sessions.html")) << message_; | 283 "sessions.html")) << message_; |
284 } | 284 } |
285 | 285 |
286 } // namespace extensions | 286 } // namespace extensions |
OLD | NEW |