Adding instrumentation to locate the source of jankiness
[chromium-blink-merge.git] / chrome / browser / ui / app_list / app_list_test_util.cc
blobda8f0791e8ecf7837e53e30abe623ece83773618
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/app_list/app_list_test_util.h"
7 #include "base/files/file_path.h"
8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/common/chrome_constants.h"
10 #include "extensions/common/extension_set.h"
12 const char AppListTestBase::kHostedAppId[] =
13 "dceacbkfkmllgmjmbhgkpjegnodmildf";
14 const char AppListTestBase::kPackagedApp1Id[] =
15 "emfkafnhnpcmabnnkckkchdilgeoekbo";
16 const char AppListTestBase::kPackagedApp2Id[] =
17 "jlklkagmeajbjiobondfhiekepofmljl";
19 AppListTestBase::AppListTestBase() {}
21 AppListTestBase::~AppListTestBase() {}
23 void AppListTestBase::SetUp() {
24 extensions::ExtensionServiceTestBase::SetUp();
26 // Load "app_list" extensions test profile.
27 // The test profile has 5 extensions:
28 // - 1 dummy extension (which should not be visible in the launcher)
29 // - 2 packaged extension apps
30 // - 1 hosted extension app
31 // - 1 ephemeral app (which should not be visible in the launcher)
32 base::FilePath source_install_dir =
33 data_dir().AppendASCII("app_list").AppendASCII("Extensions");
34 base::FilePath pref_path = source_install_dir
35 .DirName()
36 .Append(chrome::kPreferencesFilename);
37 InitializeInstalledExtensionService(pref_path, source_install_dir);
38 service_->Init();
40 // There should be 5 extensions in the test profile.
41 const extensions::ExtensionSet* extensions = service_->extensions();
42 ASSERT_EQ(static_cast<size_t>(5), extensions->size());