diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 17:52:17 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 17:52:17 +0000 |
commit | a59db43dff855a13a5d1f57865f2afacfd2c6241 (patch) | |
tree | 1fd8e2dee4b946169f620f69619d272606f844f0 /chrome/test/perf | |
parent | df9f42a8eab0069a781a07019da66a5a2a094e66 (diff) | |
download | chromium_src-a59db43dff855a13a5d1f57865f2afacfd2c6241.zip chromium_src-a59db43dff855a13a5d1f57865f2afacfd2c6241.tar.gz chromium_src-a59db43dff855a13a5d1f57865f2afacfd2c6241.tar.bz2 |
Revert "Rebuild test history databases when starting up performance_ui_tests."
This reverts commit fd99334e881859262199c9b8a98f9fbb003b20e1.
BUG=111570
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200312 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/perf')
-rw-r--r-- | chrome/test/perf/feature_startup_test.cc | 23 | ||||
-rw-r--r-- | chrome/test/perf/generate_profile.cc | 272 | ||||
-rw-r--r-- | chrome/test/perf/generate_profile.h | 29 | ||||
-rw-r--r-- | chrome/test/perf/perf_ui_test_suite.cc | 174 | ||||
-rw-r--r-- | chrome/test/perf/perf_ui_test_suite.h | 45 | ||||
-rw-r--r-- | chrome/test/perf/run_all_perfuitests.cc | 10 | ||||
-rw-r--r-- | chrome/test/perf/startup_test.cc | 32 |
7 files changed, 26 insertions, 559 deletions
diff --git a/chrome/test/perf/feature_startup_test.cc b/chrome/test/perf/feature_startup_test.cc index 70b25c7..f616afc 100644 --- a/chrome/test/perf/feature_startup_test.cc +++ b/chrome/test/perf/feature_startup_test.cc @@ -13,7 +13,6 @@ #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/window_proxy.h" #include "chrome/test/perf/perf_test.h" -#include "chrome/test/perf/perf_ui_test_suite.h" #include "chrome/test/ui/ui_perf_test.h" #include "net/base/net_util.h" #include "ui/gfx/rect.h" @@ -42,17 +41,19 @@ class NewTabUIStartupTest : public UIPerfTest { "new_tab", std::string(), label, times, "ms", important); } - void InitProfile(PerfUITestSuite::ProfileType profile_type) { + void InitProfile(UITestBase::ProfileType profile_type) { + profile_type_ = profile_type; + // Install the location of the test profile file. - set_template_user_data( - PerfUITestSuite::GetPathForProfileType(profile_type)); + set_template_user_data(UITest::ComputeTypicalUserDataSource( + profile_type)); } // Run the test, by bringing up a browser and timing the new tab startup. // |want_warm| is true if we should output warm-disk timings, false if // we should report cold timings. void RunStartupTest(const char* label, bool want_warm, bool important, - PerfUITestSuite::ProfileType profile_type) { + UITestBase::ProfileType profile_type) { InitProfile(profile_type); TimeDelta timings[kNumCycles]; @@ -100,7 +101,7 @@ class NewTabUIStartupTest : public UIPerfTest { } void RunNewTabTimingTest() { - InitProfile(PerfUITestSuite::DEFAULT_THEME); + InitProfile(UITestBase::DEFAULT_THEME); TimeDelta scriptstart_times[kNumCycles]; TimeDelta domcontentloaded_times[kNumCycles]; @@ -161,33 +162,33 @@ class NewTabUIStartupTest : public UIPerfTest { TEST_F(NewTabUIStartupTest, DISABLED_PerfRefCold) { UseReferenceBuild(); RunStartupTest("tab_cold_ref", false /* cold */, true /* important */, - PerfUITestSuite::DEFAULT_THEME); + UITestBase::DEFAULT_THEME); } // FLAKY: http://crbug.com/69940 TEST_F(NewTabUIStartupTest, DISABLED_PerfCold) { RunStartupTest("tab_cold", false /* cold */, true /* important */, - PerfUITestSuite::DEFAULT_THEME); + UITestBase::DEFAULT_THEME); } // FLAKY: http://crbug.com/69940 TEST_F(NewTabUIStartupTest, DISABLED_PerfRefWarm) { UseReferenceBuild(); RunStartupTest("tab_warm_ref", true /* warm */, true /* not important */, - PerfUITestSuite::DEFAULT_THEME); + UITestBase::DEFAULT_THEME); } // FLAKY: http://crbug.com/69940 TEST_F(NewTabUIStartupTest, DISABLED_PerfWarm) { RunStartupTest("tab_warm", true /* warm */, true /* not important */, - PerfUITestSuite::DEFAULT_THEME); + UITestBase::DEFAULT_THEME); } // FLAKY: http://crbug.com/69940 TEST_F(NewTabUIStartupTest, DISABLED_ComplexThemeCold) { RunStartupTest("tab_complex_theme_cold", false /* cold */, false /* not important */, - PerfUITestSuite::COMPLEX_THEME); + UITestBase::COMPLEX_THEME); } // FLAKY: http://crbug.com/69940 diff --git a/chrome/test/perf/generate_profile.cc b/chrome/test/perf/generate_profile.cc deleted file mode 100644 index e3dd38e..0000000 --- a/chrome/test/perf/generate_profile.cc +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/test/perf/generate_profile.h" - -#include "base/at_exit.h" -#include "base/command_line.h" -#include "base/file_util.h" -#include "base/files/file_path.h" -#include "base/i18n/icu_util.h" -#include "base/logging.h" -#include "base/message_loop.h" -#include "base/path_service.h" -#include "base/process_util.h" -#include "base/strings/string_number_conversions.h" -#include "base/time.h" -#include "base/utf_string_conversions.h" -#include "chrome/browser/history/history_service.h" -#include "chrome/browser/history/history_service_factory.h" -#include "chrome/browser/history/top_sites.h" -#include "chrome/common/chrome_paths.h" -#include "chrome/common/thumbnail_score.h" -#include "chrome/test/base/testing_browser_process.h" -#include "chrome/test/base/testing_profile.h" -#include "chrome/tools/profiles/thumbnail-inl.h" -#include "content/public/browser/browser_thread.h" -#include "content/public/browser/notification_service.h" -#include "content/public/test/test_browser_thread.h" -#include "third_party/skia/include/core/SkBitmap.h" -#include "ui/base/resource/resource_bundle.h" -#include "ui/base/ui_base_paths.h" -#include "ui/gfx/codec/jpeg_codec.h" - -using base::Time; -using content::BrowserThread; - -namespace { - -// RAII for initializing and shutting down the TestBrowserProcess -class InitBrowserProcess { - public: - InitBrowserProcess() { - DCHECK(!g_browser_process); - g_browser_process = new TestingBrowserProcess; - } - - ~InitBrowserProcess() { - DCHECK(g_browser_process); - delete g_browser_process; - g_browser_process = NULL; - } -}; - -// Probabilities of different word lengths, as measured from Darin's profile. -// kWordLengthProbabilities[n-1] = P(word of length n) -const float kWordLengthProbabilities[] = { 0.069f, 0.132f, 0.199f, - 0.137f, 0.088f, 0.115f, 0.081f, 0.055f, 0.034f, 0.021f, 0.019f, 0.018f, - 0.007f, 0.007f, 0.005f, 0.004f, 0.003f, 0.003f, 0.003f }; - -// Return a float uniformly in [0,1]. -// Useful for making probabilistic decisions. -inline float RandomFloat() { - return rand() / static_cast<float>(RAND_MAX); -} - -// Return an integer uniformly in [min,max). -inline int RandomInt(int min, int max) { - return min + (rand() % (max-min)); -} - -// Return a string of |count| lowercase random characters. -string16 RandomChars(int count) { - string16 str; - for (int i = 0; i < count; ++i) - str += L'a' + rand() % 26; - return str; -} - -string16 RandomWord() { - // TODO(evanm): should we instead use the markov chain based - // version of this that I already wrote? - - // Sample a word length from kWordLengthProbabilities. - float sample = RandomFloat(); - size_t i; - for (i = 0; i < arraysize(kWordLengthProbabilities); ++i) { - sample -= kWordLengthProbabilities[i]; - if (sample < 0) break; - } - const int word_length = i + 1; - return RandomChars(word_length); -} - -// Return a string of |count| random words. -string16 RandomWords(int count) { - string16 str; - for (int i = 0; i < count; ++i) { - if (!str.empty()) - str += L' '; - str += RandomWord(); - } - return str; -} - -// Return a random URL-looking string. -GURL ConstructRandomURL() { - return GURL(ASCIIToUTF16("http://") + RandomChars(3) + ASCIIToUTF16(".com/") + - RandomChars(RandomInt(5, 20))); -} - -// Return a random page title-looking string. -string16 ConstructRandomTitle() { - return RandomWords(RandomInt(3, 15)); -} - -// Return a random string that could function as page contents. -string16 ConstructRandomPage() { - return RandomWords(RandomInt(10, 4000)); -} - -// Insert a batch of |batch_size| URLs, starting at pageid |page_id|. -void InsertURLBatch(Profile* profile, - int page_id, - int batch_size, - int types) { - HistoryService* history_service = - HistoryServiceFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS); - - // Probability of following a link on the current "page" - // (vs randomly jumping to a new page). - const float kFollowLinkProbability = 0.85f; - // Probability of visiting a page we've visited before. - const float kRevisitLinkProbability = 0.1f; - // Probability of a URL being "good enough" to revisit. - const float kRevisitableURLProbability = 0.05f; - // Probability of a URL being the end of a redirect chain. - const float kRedirectProbability = 0.05f; - - // A list of URLs that we sometimes revisit. - std::vector<GURL> revisit_urls; - - // Scoping value for page IDs (required by the history service). - void* id_scope = reinterpret_cast<void*>(1); - - scoped_refptr<base::RefCountedMemory> google_bitmap( - new base::RefCountedStaticMemory(kGoogleThumbnail, - sizeof(kGoogleThumbnail))); - scoped_refptr<base::RefCountedMemory> weewar_bitmap( - new base::RefCountedStaticMemory(kWeewarThumbnail, - sizeof(kWeewarThumbnail))); - - printf("Inserting %d URLs...\n", batch_size); - GURL previous_url; - content::PageTransition transition = content::PAGE_TRANSITION_TYPED; - const int end_page_id = page_id + batch_size; - history::TopSites* top_sites = profile->GetTopSites(); - for (; page_id < end_page_id; ++page_id) { - // Randomly decide whether this new URL simulates following a link or - // whether it's a jump to a new URL. - if (!previous_url.is_empty() && RandomFloat() < kFollowLinkProbability) { - transition = content::PAGE_TRANSITION_LINK; - } else { - previous_url = GURL(); - transition = content::PAGE_TRANSITION_TYPED; - } - - // Pick a URL, either newly at random or from our list of previously - // visited URLs. - GURL url; - if (!revisit_urls.empty() && RandomFloat() < kRevisitLinkProbability) { - // Draw a URL from revisit_urls at random. - url = revisit_urls[RandomInt(0, static_cast<int>(revisit_urls.size()))]; - } else { - url = ConstructRandomURL(); - } - - // Randomly construct a redirect chain. - history::RedirectList redirects; - if (RandomFloat() < kRedirectProbability) { - const int redir_count = RandomInt(1, 4); - for (int i = 0; i < redir_count; ++i) - redirects.push_back(ConstructRandomURL()); - redirects.push_back(url); - } - - // Add all of this information to the history service. - history_service->AddPage(url, base::Time::Now(), - id_scope, page_id, - previous_url, redirects, - transition, history::SOURCE_BROWSED, true); - ThumbnailScore score(0.75, false, false); - history_service->SetPageTitle(url, ConstructRandomTitle()); - if (types & FULL_TEXT) - history_service->SetPageContents(url, ConstructRandomPage()); - if (types & TOP_SITES && top_sites) { - top_sites->SetPageThumbnailToJPEGBytes( - url, - (RandomInt(0, 2) == 0) ? google_bitmap.get() : weewar_bitmap.get(), - score); - } - - previous_url = url; - - if (revisit_urls.empty() || RandomFloat() < kRevisitableURLProbability) - revisit_urls.push_back(url); - } -} - -} // namespace - -bool GenerateProfile(GenerateProfileTypes types, - int url_count, - const base::FilePath& dst_dir) { - if (!file_util::CreateDirectory(dst_dir)) { - PLOG(ERROR) << "Unable to create directory " << dst_dir.value().c_str(); - return false; - } - - // We want this profile to be as deterministic as possible, so seed the - // random number generator with the number of urls we're generating. - srand(static_cast<unsigned int>(url_count)); - - printf("Creating profiles for testing...\n"); - - InitBrowserProcess initialize_browser_process; - base::MessageLoopForUI message_loop; - content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); - content::TestBrowserThread db_thread(BrowserThread::DB, &message_loop); - TestingProfile profile; - profile.CreateHistoryService(false, false); - if (types & TOP_SITES) { - profile.CreateTopSites(); - profile.BlockUntilTopSitesLoaded(); - } - - // The maximum number of URLs to insert into history in one batch. - const int kBatchSize = 2000; - int page_id = 0; - while (page_id < url_count) { - const int batch_size = std::min(kBatchSize, url_count - page_id); - InsertURLBatch(&profile, page_id, batch_size, types); - // Run all pending messages to give TopSites a chance to catch up. - message_loop.RunUntilIdle(); - page_id += batch_size; - } - - profile.DestroyTopSites(); - profile.DestroyHistoryService(); - - message_loop.RunUntilIdle(); - - file_util::FileEnumerator file_iterator(profile.GetPath(), false, - file_util::FileEnumerator::FILES); - base::FilePath path = file_iterator.Next(); - while (!path.empty()) { - base::FilePath dst_file = dst_dir.Append(path.BaseName()); - file_util::Delete(dst_file, false); - if (!file_util::CopyFile(path, dst_file)) { - PLOG(ERROR) << "Copying file failed"; - return false; - } - path = file_iterator.Next(); - } - - printf("Finished creating profiles for testing.\n"); - - // Restore the random seed. - srand(static_cast<unsigned int>(Time::Now().ToInternalValue())); - - return true; -} diff --git a/chrome/test/perf/generate_profile.h b/chrome/test/perf/generate_profile.h deleted file mode 100644 index 85a2858..0000000 --- a/chrome/test/perf/generate_profile.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_TEST_PERF_GENERATE_PROFILE_H_ -#define CHROME_TEST_PERF_GENERATE_PROFILE_H_ - -#include "base/compiler_specific.h" - -namespace base { -class FilePath; -} - -// Addition types data can be generated for. By default only urls/visits are -// added. -enum GenerateProfileTypes { - TOP_SITES = 1 << 0, - FULL_TEXT = 1 << 1 -}; - -// Generates a user profile and history by psuedo-randomly generating data and -// feeding it to the history service. (srand is initialized with whatever -// urlcount is before profile is generated for deterministic output; it is -// reset to time() afterwards.) Returns true if successful. -bool GenerateProfile(GenerateProfileTypes types, - int urlcount, - const base::FilePath& dst_dir) WARN_UNUSED_RESULT; - -#endif // CHROME_TEST_PERF_GENERATE_PROFILE_H_ diff --git a/chrome/test/perf/perf_ui_test_suite.cc b/chrome/test/perf/perf_ui_test_suite.cc deleted file mode 100644 index 05ebde4..0000000 --- a/chrome/test/perf/perf_ui_test_suite.cc +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/test/perf/perf_ui_test_suite.h" - -#include "base/file_util.h" -#include "base/json/json_file_value_serializer.h" -#include "base/lazy_instance.h" -#include "base/logging.h" -#include "base/message_loop.h" -#include "base/path_service.h" -#include "base/string_util.h" -#include "base/threading/platform_thread.h" -#include "base/utf_string_conversions.h" -#include "chrome/browser/themes/browser_theme_pack.h" -#include "chrome/common/chrome_constants.h" -#include "chrome/common/chrome_paths.h" -#include "chrome/common/extensions/extension.h" -#include "chrome/test/perf/generate_profile.h" -#include "content/public/test/test_browser_thread.h" - -#if defined(OS_WIN) -#include <atlbase.h> -#include "ui/base/resource/resource_bundle_win.h" -#endif - -using content::BrowserThread; -using extensions::Extension; - -namespace { - -const int kNumURLs = 20000; - -const char kThemeExtension[] = "mblmlcbknbnfebdfjnolmcapmdofhmme"; - -base::LazyInstance<base::FilePath> g_default_profile_dir = - LAZY_INSTANCE_INITIALIZER; -base::LazyInstance<base::FilePath> g_complex_profile_dir = - LAZY_INSTANCE_INITIALIZER; - -} // namespace - -PerfUITestSuite::PerfUITestSuite(int argc, char** argv) - : UITestSuite(argc, argv) { - base::PlatformThread::SetName("Tests_Main"); -} - -PerfUITestSuite::~PerfUITestSuite() { -} - -base::FilePath PerfUITestSuite::GetPathForProfileType( - ProfileType profile_type) { - switch (profile_type) { - case DEFAULT_THEME: - return g_default_profile_dir.Get(); - case COMPLEX_THEME: - return g_complex_profile_dir.Get(); - default: - NOTREACHED(); - return base::FilePath(); - } -} - -void PerfUITestSuite::Initialize() { -#if defined(OS_WIN) - // On Windows, make sure we've loaded the main chrome dll for its resource - // before we let our parent class initialize the shared resource bundle - // infrastructure. We have to do this manually because the extension system - // uses several resources which, on Windows, are only compiled into the - // browser DLL, but the base chrome testing stuff is used outside of browser. - // - // TODO(darin): Kill this once http://crbug.com/52609 is fixed. - base::FilePath dll; - PathService::Get(base::DIR_MODULE, &dll); - dll = dll.Append(chrome::kBrowserResourcesDll); - HMODULE res_mod = ::LoadLibraryExW(dll.value().c_str(), - NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE); - DCHECK(res_mod); - _AtlBaseModule.SetResourceInstance(res_mod); - - ui::SetResourcesDataDLL(_AtlBaseModule.GetResourceInstance()); -#endif - - UITestSuite::Initialize(); - - if (!default_profile_dir_.CreateUniqueTempDir()) { - LOG(FATAL) << "Failed to create default profile directory..."; - } - - // Build a profile in default profile dir. - base::FilePath default_path = - default_profile_dir_.path().AppendASCII("Default"); - if (!GenerateProfile(TOP_SITES, kNumURLs, default_path)) { - LOG(FATAL) << "Failed to generate default profile for tests..."; - } - - g_default_profile_dir.Get() = default_profile_dir_.path(); - - if (!complex_profile_dir_.CreateUniqueTempDir()) { - LOG(FATAL) << "Failed to create complex profile directory..."; - } - - if (!file_util::CopyDirectory(default_path, - complex_profile_dir_.path(), - true)) { - LOG(FATAL) << "Failed to copy data to complex profile directory..."; - } - - // Copy the Extensions directory from the template into the - // complex_profile_dir dir. - base::FilePath base_data_dir; - if (!PathService::Get(chrome::DIR_TEST_DATA, &base_data_dir)) - LOG(FATAL) << "Failed to fetch test data dir"; - - base_data_dir = base_data_dir.AppendASCII("profiles"); - base_data_dir = base_data_dir.AppendASCII("profile_with_complex_theme"); - base_data_dir = base_data_dir.AppendASCII("Default"); - - if (!file_util::CopyDirectory(base_data_dir, - complex_profile_dir_.path(), - true)) { - LOG(FATAL) << "Failed to copy default to complex profile"; - } - - // Parse the manifest and make a temporary extension object because the - // theme system takes extensions as input. - base::FilePath extension_base = - complex_profile_dir_.path() - .AppendASCII("Default") - .AppendASCII("Extensions") - .AppendASCII(kThemeExtension) - .AppendASCII("1.1"); - BuildCachedThemePakIn(extension_base); - - g_complex_profile_dir.Get() = complex_profile_dir_.path(); -} - -void PerfUITestSuite::BuildCachedThemePakIn( - const base::FilePath& extension_base) { - int error_code = 0; - std::string error; - JSONFileValueSerializer serializer( - extension_base.AppendASCII("manifest.json")); - scoped_ptr<DictionaryValue> valid_value(static_cast<DictionaryValue*>( - serializer.Deserialize(&error_code, &error))); - if (error_code != 0 || !valid_value) - LOG(FATAL) << "Error parsing theme manifest: " << error; - - scoped_refptr<Extension> extension = - Extension::Create(extension_base, - extensions::Manifest::INVALID_LOCATION, - *valid_value, - Extension::NO_FLAGS, - &error); - if (!extension) - LOG(FATAL) << "Error loading theme extension: " << error; - - // Build the "Cached Theme.pak" file in the template. (It's not committed - // both because committing large binary files is bad in a git world and - // because people don't remember to update it anyway, meaning we usually - // have the theme rebuild penalty in our data.) - MessageLoopForUI message_loop_; - content::TestBrowserThread ui_thread_(BrowserThread::UI, &message_loop_); - content::TestBrowserThread file_thread_(BrowserThread::FILE, - &message_loop_); - - scoped_refptr<BrowserThemePack> theme( - BrowserThemePack::BuildFromExtension(extension)); - if (!theme) - LOG(FATAL) << "Failed to load theme from extension"; - - theme->WriteToDisk(extension_base.AppendASCII("Cached Theme.pak")); -} diff --git a/chrome/test/perf/perf_ui_test_suite.h b/chrome/test/perf/perf_ui_test_suite.h deleted file mode 100644 index caa8903..0000000 --- a/chrome/test/perf/perf_ui_test_suite.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_TEST_PERF_PERF_UI_TEST_SUITE_H_ -#define CHROME_TEST_PERF_PERF_UI_TEST_SUITE_H_ - -#include "base/files/scoped_temp_dir.h" -#include "chrome/test/ui/ui_test_suite.h" - -namespace base { -class FilePath; -} - -// UITestSuite which creates two testing profiles at Initialize() time. We -// create fake profiles so we don't commit 10-20 megabytes of binary data to -// the repository each time we change the history format (or even worse, don't -// update the test profiles and have incorrect performance data!) -class PerfUITestSuite : public UITestSuite { - public: - PerfUITestSuite(int argc, char** argv); - virtual ~PerfUITestSuite(); - - // Profile theme type choices. - enum ProfileType { - DEFAULT_THEME = 0, - COMPLEX_THEME = 1, - }; - - // Returns the directory name where the "typical" user data is that we use - // for testing. - static base::FilePath GetPathForProfileType(ProfileType profile_type); - - // Overridden from UITestSuite: - virtual void Initialize() OVERRIDE; - - private: - // Builds a "Cached Theme.pak" file in |extension_base|. - void BuildCachedThemePakIn(const base::FilePath& extension_base); - - base::ScopedTempDir default_profile_dir_; - base::ScopedTempDir complex_profile_dir_; -}; - -#endif // CHROME_TEST_PERF_PERF_UI_TEST_SUITE_H_ diff --git a/chrome/test/perf/run_all_perfuitests.cc b/chrome/test/perf/run_all_perfuitests.cc deleted file mode 100644 index 7ec1c00..0000000 --- a/chrome/test/perf/run_all_perfuitests.cc +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/test/perf/perf_ui_test_suite.h" - -int main(int argc, char **argv) { - return PerfUITestSuite(argc, argv).Run(); -} - diff --git a/chrome/test/perf/startup_test.cc b/chrome/test/perf/startup_test.cc index ea14b85..f8ab9f8 100644 --- a/chrome/test/perf/startup_test.cc +++ b/chrome/test/perf/startup_test.cc @@ -23,7 +23,6 @@ #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/ui_test_utils.h" #include "chrome/test/perf/perf_test.h" -#include "chrome/test/perf/perf_ui_test_suite.h" #include "chrome/test/ui/ui_perf_test.h" #include "content/public/common/content_switches.h" #include "net/base/net_util.h" @@ -104,7 +103,7 @@ class StartupTest : public UIPerfTest { // Rewrite the preferences file to point to the proper image directory. virtual void SetUpProfile() OVERRIDE { UIPerfTest::SetUpProfile(); - if (profile_type_ != PerfUITestSuite::COMPLEX_THEME) + if (profile_type_ != UITestBase::COMPLEX_THEME) return; const base::FilePath pref_template_path(user_data_dir(). @@ -149,16 +148,16 @@ class StartupTest : public UIPerfTest { void RunStartupTest(const char* graph, const char* trace, TestColdness test_cold, TestImportance test_importance, - PerfUITestSuite::ProfileType profile_type, + UITestBase::ProfileType profile_type, int num_tabs, int nth_timed_tab) { bool important = (test_importance == IMPORTANT); profile_type_ = profile_type; // Sets the profile data for the run. For now, this is only used for // the non-default themes test. - if (profile_type != PerfUITestSuite::DEFAULT_THEME) { - set_template_user_data( - PerfUITestSuite::GetPathForProfileType(profile_type)); + if (profile_type != UITestBase::DEFAULT_THEME) { + set_template_user_data(UITest::ComputeTypicalUserDataSource( + profile_type)); } #if defined(NDEBUG) @@ -302,20 +301,17 @@ class StartupTest : public UIPerfTest { base::FilePath profiling_file_; bool collect_profiling_stats_; std::string trace_file_prefix_; - - // Are we using a profile with a complex theme? - PerfUITestSuite::ProfileType profile_type_; }; TEST_F(StartupTest, PerfWarm) { RunStartupTest("warm", "t", WARM, IMPORTANT, - PerfUITestSuite::DEFAULT_THEME, 0, 0); + UITestBase::DEFAULT_THEME, 0, 0); } TEST_F(StartupTest, PerfReferenceWarm) { UseReferenceBuild(); RunStartupTest("warm", "t_ref", WARM, IMPORTANT, - PerfUITestSuite::DEFAULT_THEME, 0, 0); + UITestBase::DEFAULT_THEME, 0, 0); } // TODO(mpcomplete): Should we have reference timings for all these? @@ -329,7 +325,7 @@ TEST_F(StartupTest, PerfReferenceWarm) { TEST_F(StartupTest, MAYBE_PerfCold) { RunStartupTest("cold", "t", COLD, NOT_IMPORTANT, - PerfUITestSuite::DEFAULT_THEME, 0, 0); + UITestBase::DEFAULT_THEME, 0, 0); } void StartupTest::RunPerfTestWithManyTabs(const char* graph, const char* trace, @@ -365,7 +361,7 @@ void StartupTest::RunPerfTestWithManyTabs(const char* graph, const char* trace, launch_arguments_ = new_launch_arguments; } RunStartupTest(graph, trace, WARM, NOT_IMPORTANT, - PerfUITestSuite::DEFAULT_THEME, tab_count, nth_timed_tab); + UITestBase::DEFAULT_THEME, tab_count, nth_timed_tab); } // http://crbug.com/101591 @@ -448,33 +444,33 @@ TEST_F(StartupTest, PerfExtensionEmpty) { SetUpWithFileURL(); SetUpWithExtensionsProfile("empty"); RunStartupTest("warm", "extension_empty", WARM, NOT_IMPORTANT, - PerfUITestSuite::DEFAULT_THEME, 1, 0); + UITestBase::DEFAULT_THEME, 1, 0); } TEST_F(StartupTest, PerfExtensionContentScript1) { SetUpWithFileURL(); SetUpWithExtensionsProfile("content_scripts1"); RunStartupTest("warm", "extension_content_scripts1", WARM, NOT_IMPORTANT, - PerfUITestSuite::DEFAULT_THEME, 1, 0); + UITestBase::DEFAULT_THEME, 1, 0); } TEST_F(StartupTest, MAYBE_PerfExtensionContentScript50) { SetUpWithFileURL(); SetUpWithExtensionsProfile("content_scripts50"); RunStartupTest("warm", "extension_content_scripts50", WARM, NOT_IMPORTANT, - PerfUITestSuite::DEFAULT_THEME, 1, 0); + UITestBase::DEFAULT_THEME, 1, 0); } TEST_F(StartupTest, MAYBE_PerfComplexTheme) { RunStartupTest("warm", "t-theme", WARM, NOT_IMPORTANT, - PerfUITestSuite::COMPLEX_THEME, 0, 0); + UITestBase::COMPLEX_THEME, 0, 0); } TEST_F(StartupTest, ProfilingScript1) { SetUpWithFileURL(); SetUpWithProfiling(); RunStartupTest("warm", "profiling_scripts1", WARM, NOT_IMPORTANT, - PerfUITestSuite::DEFAULT_THEME, 1, 0); + UITestBase::DEFAULT_THEME, 1, 0); } } // namespace |