OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 // This file provides reliablity tests which run for ChromeFrame. | 5 // This file provides reliablity tests which run for ChromeFrame. |
6 // | 6 // |
7 // Usage: | 7 // Usage: |
8 // <reliability test exe> --list=file --startline=start --endline=end [...] | 8 // <reliability test exe> --list=file --startline=start --endline=end [...] |
9 // Upon invocation, it visits each of the URLs on line numbers between start | 9 // Upon invocation, it visits each of the URLs on line numbers between start |
10 // and end, inclusive, stored in the input file. The line number starts from 1. | 10 // and end, inclusive, stored in the input file. The line number starts from 1. |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "base/i18n/time_formatting.h" | 29 #include "base/i18n/time_formatting.h" |
30 #include "base/path_service.h" | 30 #include "base/path_service.h" |
31 #include "base/string_number_conversions.h" | 31 #include "base/string_number_conversions.h" |
32 #include "base/string_util.h" | 32 #include "base/string_util.h" |
33 #include "base/test/test_file_util.h" | 33 #include "base/test/test_file_util.h" |
34 #include "base/time.h" | 34 #include "base/time.h" |
35 #include "base/utf_string_conversions.h" | 35 #include "base/utf_string_conversions.h" |
36 #include "chrome/browser/browser_thread.h" | 36 #include "chrome/browser/browser_thread.h" |
37 #include "chrome/browser/net/url_fixer_upper.h" | 37 #include "chrome/browser/net/url_fixer_upper.h" |
38 #include "chrome/browser/prefs/pref_service.h" | 38 #include "chrome/browser/prefs/pref_service.h" |
| 39 #include "chrome/browser/prefs/pref_service_mock_builder.h" |
39 #include "chrome/browser/prefs/pref_value_store.h" | 40 #include "chrome/browser/prefs/pref_value_store.h" |
40 #include "chrome/common/automation_messages.h" | 41 #include "chrome/common/automation_messages.h" |
41 #include "chrome/common/chrome_constants.h" | 42 #include "chrome/common/chrome_constants.h" |
42 #include "chrome/common/chrome_paths.h" | 43 #include "chrome/common/chrome_paths.h" |
43 #include "chrome/common/chrome_paths_internal.h" | 44 #include "chrome/common/chrome_paths_internal.h" |
44 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
45 #include "chrome/common/json_pref_store.h" | 46 #include "chrome/common/json_pref_store.h" |
46 #include "chrome/common/logging_chrome.h" | 47 #include "chrome/common/logging_chrome.h" |
47 #include "chrome/common/pref_names.h" | 48 #include "chrome/common/pref_names.h" |
48 #include "chrome_frame/test/chrome_frame_test_utils.h" | |
49 #include "chrome_frame/test/ie_event_sink.h" | |
50 #include "chrome/test/automation/automation_proxy.h" | 49 #include "chrome/test/automation/automation_proxy.h" |
51 #include "chrome/test/automation/browser_proxy.h" | 50 #include "chrome/test/automation/browser_proxy.h" |
52 #include "chrome/test/automation/tab_proxy.h" | 51 #include "chrome/test/automation/tab_proxy.h" |
53 #include "chrome/test/automation/window_proxy.h" | 52 #include "chrome/test/automation/window_proxy.h" |
| 53 #include "chrome/test/reliability/page_load_test.h" |
54 #include "chrome/test/ui/ui_test.h" | 54 #include "chrome/test/ui/ui_test.h" |
55 #include "chrome/test/reliability/page_load_test.h" | 55 #include "chrome_frame/test/chrome_frame_test_utils.h" |
| 56 #include "chrome_frame/test/ie_event_sink.h" |
56 #include "chrome_frame/utils.h" | 57 #include "chrome_frame/utils.h" |
57 #include "net/base/net_util.h" | 58 #include "net/base/net_util.h" |
58 #include "testing/gmock/include/gmock/gmock.h" | 59 #include "testing/gmock/include/gmock/gmock.h" |
59 #include "testing/gtest/include/gtest/gtest.h" | 60 #include "testing/gtest/include/gtest/gtest.h" |
60 | 61 |
61 using testing::StrCaseEq; | 62 using testing::StrCaseEq; |
62 using testing::StrCaseNe; | 63 using testing::StrCaseNe; |
63 | 64 |
64 namespace { | 65 namespace { |
65 | 66 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 } | 420 } |
420 } | 421 } |
421 if (metrics) | 422 if (metrics) |
422 metrics->crash_dump_count = num_dumps; | 423 metrics->crash_dump_count = num_dumps; |
423 } | 424 } |
424 | 425 |
425 // Get a PrefService whose contents correspond to the Local State file | 426 // Get a PrefService whose contents correspond to the Local State file |
426 // that was saved by the app as it closed. The caller takes ownership of the | 427 // that was saved by the app as it closed. The caller takes ownership of the |
427 // returned PrefService object. | 428 // returned PrefService object. |
428 PrefService* GetLocalState() { | 429 PrefService* GetLocalState() { |
429 FilePath local_state_path; | 430 FilePath path; |
430 chrome::GetChromeFrameUserDataDirectory(&local_state_path); | 431 chrome::GetChromeFrameUserDataDirectory(&path); |
431 | 432 return PrefServiceMockBuilder().WithUserFilePrefs(path).Create(); |
432 PrefService* local_state = PrefService::CreateUserPrefService( | |
433 local_state_path); | |
434 return local_state; | |
435 } | 433 } |
436 | 434 |
437 void GetStabilityMetrics(NavigationMetrics* metrics) { | 435 void GetStabilityMetrics(NavigationMetrics* metrics) { |
438 if (!metrics) | 436 if (!metrics) |
439 return; | 437 return; |
440 scoped_ptr<PrefService> local_state(GetLocalState()); | 438 scoped_ptr<PrefService> local_state(GetLocalState()); |
441 if (!local_state.get()) | 439 if (!local_state.get()) |
442 return; | 440 return; |
443 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); | 441 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); |
444 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); | 442 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); | 578 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); |
581 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { | 579 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { |
582 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch); | 580 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch); |
583 if (!file_util::AbsolutePath(&g_v8_log_path)) | 581 if (!file_util::AbsolutePath(&g_v8_log_path)) |
584 g_v8_log_path = FilePath(); | 582 g_v8_log_path = FilePath(); |
585 } | 583 } |
586 } | 584 } |
587 } | 585 } |
588 } | 586 } |
589 } | 587 } |
OLD | NEW |