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 "chrome/browser/profiles/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
10 #include "base/version.h" | 10 #include "base/version.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // Assert that created_by_version pref gets set to current version. | 49 // Assert that created_by_version pref gets set to current version. |
50 EXPECT_EQ(created_by_version, pref_version); | 50 EXPECT_EQ(created_by_version, pref_version); |
51 } | 51 } |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
55 typedef InProcessBrowserTest ProfileBrowserTest; | 55 typedef InProcessBrowserTest ProfileBrowserTest; |
56 | 56 |
57 // Test OnProfileCreate is called with is_new_profile set to true when | 57 // Test OnProfileCreate is called with is_new_profile set to true when |
58 // creating a new profile synchronously. | 58 // creating a new profile synchronously. |
59 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, CreateNewProfileSynchronous) { | 59 // |
| 60 // Flaky (sometimes timeout): http://crbug.com/141141 |
| 61 IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, |
| 62 DISABLED_CreateNewProfileSynchronous) { |
60 ScopedTempDir temp_dir; | 63 ScopedTempDir temp_dir; |
61 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 64 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
62 | 65 |
63 MockProfileDelegate delegate; | 66 MockProfileDelegate delegate; |
64 EXPECT_CALL(delegate, OnProfileCreated(testing::NotNull(), true, true)); | 67 EXPECT_CALL(delegate, OnProfileCreated(testing::NotNull(), true, true)); |
65 | 68 |
66 scoped_ptr<Profile> profile(Profile::CreateProfile( | 69 scoped_ptr<Profile> profile(Profile::CreateProfile( |
67 temp_dir.path(), &delegate, Profile::CREATE_MODE_SYNCHRONOUS)); | 70 temp_dir.path(), &delegate, Profile::CREATE_MODE_SYNCHRONOUS)); |
68 ASSERT_TRUE(profile.get()); | 71 ASSERT_TRUE(profile.get()); |
69 CheckChromeVersion(profile.get(), true); | 72 CheckChromeVersion(profile.get(), true); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 scoped_ptr<Profile> profile(Profile::CreateProfile( | 173 scoped_ptr<Profile> profile(Profile::CreateProfile( |
171 temp_dir.path(), &delegate, Profile::CREATE_MODE_SYNCHRONOUS)); | 174 temp_dir.path(), &delegate, Profile::CREATE_MODE_SYNCHRONOUS)); |
172 ASSERT_TRUE(profile.get()); | 175 ASSERT_TRUE(profile.get()); |
173 | 176 |
174 // Delete the Profile instance and run pending tasks (this includes the task | 177 // Delete the Profile instance and run pending tasks (this includes the task |
175 // for README creation). | 178 // for README creation). |
176 profile.reset(); | 179 profile.reset(); |
177 content::RunAllPendingInMessageLoop(); | 180 content::RunAllPendingInMessageLoop(); |
178 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); | 181 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); |
179 } | 182 } |
OLD | NEW |