| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
| 8 #include <signal.h> | 8 #include <signal.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #endif | 10 #endif |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "chrome/common/logging_chrome.h" | 39 #include "chrome/common/logging_chrome.h" |
| 40 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
| 41 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
| 42 #include "chrome/test/automation/automation_proxy.h" | 42 #include "chrome/test/automation/automation_proxy.h" |
| 43 #include "chrome/test/automation/browser_proxy.h" | 43 #include "chrome/test/automation/browser_proxy.h" |
| 44 #include "chrome/test/automation/javascript_execution_controller.h" | 44 #include "chrome/test/automation/javascript_execution_controller.h" |
| 45 #include "chrome/test/automation/proxy_launcher.h" | 45 #include "chrome/test/automation/proxy_launcher.h" |
| 46 #include "chrome/test/automation/tab_proxy.h" | 46 #include "chrome/test/automation/tab_proxy.h" |
| 47 #include "chrome/test/automation/window_proxy.h" | 47 #include "chrome/test/automation/window_proxy.h" |
| 48 #include "chrome/test/base/chrome_process_util.h" | 48 #include "chrome/test/base/chrome_process_util.h" |
| 49 #include "chrome/test/base/testing_profile.h" |
| 49 #include "chrome/test/base/test_switches.h" | 50 #include "chrome/test/base/test_switches.h" |
| 50 #include "content/common/debug_flags.h" | 51 #include "content/common/debug_flags.h" |
| 51 #include "googleurl/src/gurl.h" | 52 #include "googleurl/src/gurl.h" |
| 52 #include "net/base/net_util.h" | 53 #include "net/base/net_util.h" |
| 53 #include "ui/gl/gl_implementation.h" | 54 #include "ui/gl/gl_implementation.h" |
| 54 | 55 |
| 55 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
| 56 #include "base/win/windows_version.h" | 57 #include "base/win/windows_version.h" |
| 57 #endif | 58 #endif |
| 58 | 59 |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 | 578 |
| 578 DictionaryValue* UITest::GetLocalState() { | 579 DictionaryValue* UITest::GetLocalState() { |
| 579 FilePath local_state_path; | 580 FilePath local_state_path; |
| 580 PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); | 581 PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); |
| 581 return LoadDictionaryValueFromPath(local_state_path); | 582 return LoadDictionaryValueFromPath(local_state_path); |
| 582 } | 583 } |
| 583 | 584 |
| 584 DictionaryValue* UITest::GetDefaultProfilePreferences() { | 585 DictionaryValue* UITest::GetDefaultProfilePreferences() { |
| 585 FilePath path; | 586 FilePath path; |
| 586 PathService::Get(chrome::DIR_USER_DATA, &path); | 587 PathService::Get(chrome::DIR_USER_DATA, &path); |
| 587 path = path.AppendASCII(chrome::kInitialProfile); | 588 path = path.AppendASCII(TestingProfile::kTestUserProfileDir); |
| 588 return LoadDictionaryValueFromPath(path.Append(chrome::kPreferencesFilename)); | 589 return LoadDictionaryValueFromPath(path.Append(chrome::kPreferencesFilename)); |
| 589 } | 590 } |
| 590 | 591 |
| 591 void UITest::WaitForFinish(const std::string &name, | 592 void UITest::WaitForFinish(const std::string &name, |
| 592 const std::string &id, | 593 const std::string &id, |
| 593 const GURL &url, | 594 const GURL &url, |
| 594 const std::string& test_complete_cookie, | 595 const std::string& test_complete_cookie, |
| 595 const std::string& expected_cookie_value, | 596 const std::string& expected_cookie_value, |
| 596 const int wait_time) { | 597 const int wait_time) { |
| 597 // The webpage being tested has javascript which sets a cookie | 598 // The webpage being tested has javascript which sets a cookie |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 &session_end_completed)); | 727 &session_end_completed)); |
| 727 ASSERT_TRUE(session_end_completed); | 728 ASSERT_TRUE(session_end_completed); |
| 728 | 729 |
| 729 // Make sure session restore says we didn't crash. | 730 // Make sure session restore says we didn't crash. |
| 730 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); | 731 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); |
| 731 ASSERT_TRUE(profile_prefs.get()); | 732 ASSERT_TRUE(profile_prefs.get()); |
| 732 ASSERT_TRUE(profile_prefs->GetBoolean(prefs::kSessionExitedCleanly, | 733 ASSERT_TRUE(profile_prefs->GetBoolean(prefs::kSessionExitedCleanly, |
| 733 &exited_cleanly)); | 734 &exited_cleanly)); |
| 734 ASSERT_TRUE(exited_cleanly); | 735 ASSERT_TRUE(exited_cleanly); |
| 735 } | 736 } |
| OLD | NEW |