OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ash/app_list/app_list_item_group_model.h" | 5 #include "ash/app_list/app_list_item_group_model.h" |
6 #include "ash/app_list/app_list_item_model.h" | 6 #include "ash/app_list/app_list_item_model.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/ui/views/aura/app_list/app_list_model_builder.h" | 9 #include "chrome/browser/ui/views/aura/app_list/app_list_model_builder.h" |
10 #include "chrome/browser/extensions/extension_service_unittest.h" | 10 #include "chrome/browser/extensions/extension_service_unittest.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 FilePath pref_path = source_install_dir | 26 FilePath pref_path = source_install_dir |
27 .DirName() | 27 .DirName() |
28 .AppendASCII("Preferences"); | 28 .AppendASCII("Preferences"); |
29 InitializeInstalledExtensionService(pref_path, source_install_dir); | 29 InitializeInstalledExtensionService(pref_path, source_install_dir); |
30 service_->Init(); | 30 service_->Init(); |
31 | 31 |
32 // There should be 4 extensions in the test profile. | 32 // There should be 4 extensions in the test profile. |
33 const ExtensionSet* extensions = service_->extensions(); | 33 const ExtensionSet* extensions = service_->extensions(); |
34 ASSERT_EQ(static_cast<size_t>(4), extensions->size()); | 34 ASSERT_EQ(static_cast<size_t>(4), extensions->size()); |
35 | 35 |
36 scoped_ptr<aura_shell::AppListModel> model(new aura_shell::AppListModel()); | 36 scoped_ptr<ash::AppListModel> model(new ash::AppListModel()); |
37 AppListModelBuilder builder(profile_.get(), model.get()); | 37 AppListModelBuilder builder(profile_.get(), model.get()); |
38 builder.GetExtensionApps(); | 38 builder.GetExtensionApps(); |
39 | 39 |
40 // Expect to have two app groups. | 40 // Expect to have two app groups. |
41 EXPECT_EQ(2, model->group_count()); | 41 EXPECT_EQ(2, model->group_count()); |
42 | 42 |
43 // Two packaged apps are on the first page and hosted app on the 2nd page. | 43 // Two packaged apps are on the first page and hosted app on the 2nd page. |
44 aura_shell::AppListItemGroupModel* group1 = model->GetGroup(0); | 44 ash::AppListItemGroupModel* group1 = model->GetGroup(0); |
45 EXPECT_EQ("Packaged App 1", group1->GetItem(0)->title()); | 45 EXPECT_EQ("Packaged App 1", group1->GetItem(0)->title()); |
46 EXPECT_EQ("Packaged App 2", group1->GetItem(1)->title()); | 46 EXPECT_EQ("Packaged App 2", group1->GetItem(1)->title()); |
47 | 47 |
48 aura_shell::AppListItemGroupModel* group2 = model->GetGroup(1); | 48 ash::AppListItemGroupModel* group2 = model->GetGroup(1); |
49 EXPECT_EQ("Hosted App", group2->GetItem(0)->title()); | 49 EXPECT_EQ("Hosted App", group2->GetItem(0)->title()); |
50 } | 50 } |
OLD | NEW |