| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/environment.h" |
| 6 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 9 #include "base/platform_thread.h" | 10 #include "base/platform_thread.h" |
| 11 #include "base/scoped_ptr.h" |
| 10 #include "base/time.h" | 12 #include "base/time.h" |
| 11 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 12 #include "chrome/app/chrome_dll_resource.h" | 14 #include "chrome/app/chrome_dll_resource.h" |
| 13 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
| 14 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome/common/env_vars.h" | 17 #include "chrome/common/env_vars.h" |
| 16 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 17 #include "chrome/test/automation/tab_proxy.h" | 19 #include "chrome/test/automation/tab_proxy.h" |
| 18 #include "chrome/test/automation/browser_proxy.h" | 20 #include "chrome/test/automation/browser_proxy.h" |
| 19 #include "chrome/test/ui/ui_test.h" | 21 #include "chrome/test/ui/ui_test.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 37 path_prefix_ = path_prefix_.AppendASCII("tab_switching"); | 39 path_prefix_ = path_prefix_.AppendASCII("tab_switching"); |
| 38 | 40 |
| 39 show_window_ = true; | 41 show_window_ = true; |
| 40 } | 42 } |
| 41 | 43 |
| 42 void SetUp() { | 44 void SetUp() { |
| 43 // Set the log_file_name_ path according to the selected browser_directory_. | 45 // Set the log_file_name_ path according to the selected browser_directory_. |
| 44 log_file_name_ = browser_directory_.AppendASCII("chrome_debug.log"); | 46 log_file_name_ = browser_directory_.AppendASCII("chrome_debug.log"); |
| 45 | 47 |
| 46 // Set the log file path for the browser test. | 48 // Set the log file path for the browser test. |
| 49 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 47 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 48 SetEnvironmentVariable(UTF8ToWide(env_vars::kLogFileName).c_str(), | 51 env->SetVar(env_vars::kLogFileName, WideToUTF8(log_file_name_.value())); |
| 49 log_file_name_.value().c_str()); | |
| 50 #else | 52 #else |
| 51 setenv(env_vars::kLogFileName, | 53 env->SetVar(env_vars::kLogFileName, log_file_name_.value()); |
| 52 log_file_name_.value().c_str(), 1); | |
| 53 #endif | 54 #endif |
| 54 | 55 |
| 55 // Add the necessary arguments to Chrome's launch command for these tests. | 56 // Add the necessary arguments to Chrome's launch command for these tests. |
| 56 AddLaunchArguments(); | 57 AddLaunchArguments(); |
| 57 | 58 |
| 58 // Run the rest of the UITest initialization. | 59 // Run the rest of the UITest initialization. |
| 59 UITest::SetUp(); | 60 UITest::SetUp(); |
| 60 } | 61 } |
| 61 | 62 |
| 62 static const int kNumCycles = 5; | 63 static const int kNumCycles = 5; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 TEST_F(TabSwitchingUITest, TabSwitch) { | 185 TEST_F(TabSwitchingUITest, TabSwitch) { |
| 185 RunTabSwitchingUITest("t", true); | 186 RunTabSwitchingUITest("t", true); |
| 186 } | 187 } |
| 187 | 188 |
| 188 TEST_F(TabSwitchingUITest, TabSwitchRef) { | 189 TEST_F(TabSwitchingUITest, TabSwitchRef) { |
| 189 UseReferenceBuild(); | 190 UseReferenceBuild(); |
| 190 RunTabSwitchingUITest("t_ref", true); | 191 RunTabSwitchingUITest("t_ref", true); |
| 191 } | 192 } |
| 192 | 193 |
| 193 } // namespace | 194 } // namespace |
| OLD | NEW |