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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/app_list/profile_loader.h" | 9 #include "chrome/browser/ui/app_list/profile_loader.h" |
10 #include "chrome/browser/ui/app_list/test/fake_profile.h" | 10 #include "chrome/browser/ui/app_list/test/fake_profile.h" |
11 #include "chrome/browser/ui/app_list/test/fake_profile_store.h" | 11 #include "chrome/browser/ui/app_list/test/fake_profile_store.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 class ProfileLoaderUnittest : public testing::Test { | 14 class ProfileLoaderUnittest : public testing::Test { |
15 public: | 15 public: |
16 virtual void SetUp() OVERRIDE { | 16 virtual void SetUp() override { |
17 last_callback_result_ = NULL; | 17 last_callback_result_ = NULL; |
18 profile1_.reset( | 18 profile1_.reset( |
19 new FakeProfile("p1", base::FilePath(FILE_PATH_LITERAL("profile1")))); | 19 new FakeProfile("p1", base::FilePath(FILE_PATH_LITERAL("profile1")))); |
20 profile2_.reset( | 20 profile2_.reset( |
21 new FakeProfile("p2", base::FilePath(FILE_PATH_LITERAL("profile2")))); | 21 new FakeProfile("p2", base::FilePath(FILE_PATH_LITERAL("profile2")))); |
22 | 22 |
23 profile_store_.reset(new FakeProfileStore( | 23 profile_store_.reset(new FakeProfileStore( |
24 base::FilePath(FILE_PATH_LITERAL("udd")))); | 24 base::FilePath(FILE_PATH_LITERAL("udd")))); |
25 loader_.reset(new ProfileLoader(profile_store_.get())); | 25 loader_.reset(new ProfileLoader(profile_store_.get())); |
26 } | 26 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 StartLoadingProfile(profile1_.get()); | 108 StartLoadingProfile(profile1_.get()); |
109 loader_->InvalidatePendingProfileLoads(); | 109 loader_->InvalidatePendingProfileLoads(); |
110 // The profile is still considered loading even though we will do nothing when | 110 // The profile is still considered loading even though we will do nothing when |
111 // it gets here. | 111 // it gets here. |
112 EXPECT_TRUE(loader_->IsAnyProfileLoading()); | 112 EXPECT_TRUE(loader_->IsAnyProfileLoading()); |
113 EXPECT_TRUE(HasKeepAlive()); | 113 EXPECT_TRUE(HasKeepAlive()); |
114 | 114 |
115 FinishLoadingProfile(profile1_.get()); | 115 FinishLoadingProfile(profile1_.get()); |
116 EXPECT_EQ(NULL, last_callback_result_); | 116 EXPECT_EQ(NULL, last_callback_result_); |
117 } | 117 } |
OLD | NEW |