| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/test/ui/ui_test.h" | 5 #include "chrome/test/ui/ui_test.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 #elif defined(OS_POSIX) | 356 #elif defined(OS_POSIX) |
| 357 // Sometimes one needs to run the browser under a special environment | 357 // Sometimes one needs to run the browser under a special environment |
| 358 // (e.g. valgrind) without also running the test harness (e.g. python) | 358 // (e.g. valgrind) without also running the test harness (e.g. python) |
| 359 // under the special environment. Provide a way to wrap the browser | 359 // under the special environment. Provide a way to wrap the browser |
| 360 // commandline with a special prefix to invoke the special environment. | 360 // commandline with a special prefix to invoke the special environment. |
| 361 const char* browser_wrapper = getenv("BROWSER_WRAPPER"); | 361 const char* browser_wrapper = getenv("BROWSER_WRAPPER"); |
| 362 if (browser_wrapper) { | 362 if (browser_wrapper) { |
| 363 CommandLine wrapped_command(ASCIIToWide(browser_wrapper)); | 363 CommandLine wrapped_command(ASCIIToWide(browser_wrapper)); |
| 364 wrapped_command.AppendArguments(command_line, true); | 364 wrapped_command.AppendArguments(command_line, true); |
| 365 command_line = wrapped_command; | 365 command_line = wrapped_command; |
| 366 LOG(INFO) << "BROWSER_WRAPPER was set, prefixing command_line with " << brow
ser_wrapper; | 366 LOG(INFO) << "BROWSER_WRAPPER was set, prefixing command_line with " |
| 367 << browser_wrapper; |
| 367 } | 368 } |
| 368 | 369 |
| 369 bool started = base::LaunchApp(command_line.argv(), | 370 bool started = base::LaunchApp(command_line.argv(), |
| 370 server_->fds_to_map(), | 371 server_->fds_to_map(), |
| 371 false, // Don't wait. | 372 false, // Don't wait. |
| 372 &process_); | 373 &process_); |
| 373 #endif | 374 #endif |
| 374 ASSERT_TRUE(started); | 375 ASSERT_TRUE(started); |
| 375 | 376 |
| 376 #if defined(OS_WIN) | 377 #if defined(OS_WIN) |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 void UITest::PrintResult(const std::string& measurement, | 806 void UITest::PrintResult(const std::string& measurement, |
| 806 const std::string& modifier, | 807 const std::string& modifier, |
| 807 const std::string& trace, | 808 const std::string& trace, |
| 808 size_t value, | 809 size_t value, |
| 809 const std::string& units, | 810 const std::string& units, |
| 810 bool important) { | 811 bool important) { |
| 811 PrintResultsImpl(measurement, modifier, trace, UintToString(value), | 812 PrintResultsImpl(measurement, modifier, trace, UintToString(value), |
| 812 "", "", units, important); | 813 "", "", units, important); |
| 813 } | 814 } |
| 814 | 815 |
| 816 void UITest::PrintResult(const std::string& measurement, |
| 817 const std::string& modifier, |
| 818 const std::string& trace, |
| 819 const std::string& value, |
| 820 const std::string& units, |
| 821 bool important) { |
| 822 PrintResultsImpl(measurement, modifier, trace, value, "", "", units, |
| 823 important); |
| 824 } |
| 825 |
| 815 void UITest::PrintResultMeanAndError(const std::string& measurement, | 826 void UITest::PrintResultMeanAndError(const std::string& measurement, |
| 816 const std::string& modifier, | 827 const std::string& modifier, |
| 817 const std::string& trace, | 828 const std::string& trace, |
| 818 const std::string& mean_and_error, | 829 const std::string& mean_and_error, |
| 819 const std::string& units, | 830 const std::string& units, |
| 820 bool important) { | 831 bool important) { |
| 821 PrintResultsImpl(measurement, modifier, trace, mean_and_error, | 832 PrintResultsImpl(measurement, modifier, trace, mean_and_error, |
| 822 "{", "}", units, important); | 833 "{", "}", units, important); |
| 823 } | 834 } |
| 824 | 835 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 850 } | 861 } |
| 851 | 862 |
| 852 bool UITest::EvictFileFromSystemCacheWrapper(const FilePath& path) { | 863 bool UITest::EvictFileFromSystemCacheWrapper(const FilePath& path) { |
| 853 for (int i = 0; i < 10; i++) { | 864 for (int i = 0; i < 10; i++) { |
| 854 if (file_util::EvictFileFromSystemCache(path)) | 865 if (file_util::EvictFileFromSystemCache(path)) |
| 855 return true; | 866 return true; |
| 856 PlatformThread::Sleep(1000); | 867 PlatformThread::Sleep(1000); |
| 857 } | 868 } |
| 858 return false; | 869 return false; |
| 859 } | 870 } |
| OLD | NEW |