OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_frame/test/chrome_frame_test_utils.h" | 5 #include "chrome_frame/test/chrome_frame_test_utils.h" |
6 | 6 |
7 #include <atlapp.h> | 7 #include <atlapp.h> |
8 #include <atlmisc.h> | 8 #include <atlmisc.h> |
9 #include <iepmapi.h> | 9 #include <iepmapi.h> |
10 #include <sddl.h> | 10 #include <sddl.h> |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/file_version_info.h" | 14 #include "base/file_version_info.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/process_util.h" | 16 #include "base/process_util.h" |
17 #include "base/scoped_ptr.h" | 17 #include "base/scoped_ptr.h" |
18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
19 #include "base/stringprintf.h" | 19 #include "base/stringprintf.h" |
20 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
21 #include "base/win/registry.h" | 21 #include "base/win/registry.h" |
22 #include "base/win/scoped_handle.h" | 22 #include "base/win/scoped_handle.h" |
23 #include "base/win/windows_version.h" | 23 #include "base/win/windows_version.h" |
24 #include "ceee/ie/common/ceee_util.h" | |
25 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
26 #include "chrome/common/chrome_paths.h" | 25 #include "chrome/common/chrome_paths.h" |
27 #include "chrome/common/chrome_paths_internal.h" | 26 #include "chrome/common/chrome_paths_internal.h" |
28 #include "chrome_frame/utils.h" | 27 #include "chrome_frame/utils.h" |
29 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
30 #include "ui/base/clipboard/clipboard.h" | 29 #include "ui/base/clipboard/clipboard.h" |
31 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 30 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
32 | 31 |
33 namespace chrome_frame_test { | 32 namespace chrome_frame_test { |
34 | 33 |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 return IE_8; | 430 return IE_8; |
432 case '9': | 431 case '9': |
433 return IE_9; | 432 return IE_9; |
434 default: | 433 default: |
435 break; | 434 break; |
436 } | 435 } |
437 | 436 |
438 return IE_UNSUPPORTED; | 437 return IE_UNSUPPORTED; |
439 } | 438 } |
440 | 439 |
441 // TODO(joi@chromium.org) Could share this code with chrome_frame_plugin.h | |
442 FilePath GetProfilePathForIE() { | 440 FilePath GetProfilePathForIE() { |
443 FilePath profile_path; | 441 FilePath profile_path; |
444 // Browsers without IDeleteBrowsingHistory in non-priv mode | 442 // Browsers without IDeleteBrowsingHistory in non-priv mode |
445 // have their profiles moved into "Temporary Internet Files". | 443 // have their profiles moved into "Temporary Internet Files". |
446 // The code below basically retrieves the version of IE and computes | 444 // The code below basically retrieves the version of IE and computes |
447 // the profile directory accordingly. | 445 // the profile directory accordingly. |
448 if (GetInstalledIEVersion() <= IE_7 && !ceee_util::IsIeCeeeRegistered()) { | 446 if (GetInstalledIEVersion() <= IE_7) { |
449 profile_path = GetIETemporaryFilesFolder(); | 447 profile_path = GetIETemporaryFilesFolder(); |
450 profile_path = profile_path.Append(L"Google Chrome Frame"); | 448 profile_path = profile_path.Append(L"Google Chrome Frame"); |
451 } else { | 449 } else { |
452 profile_path = GetProfilePath(kIEProfileName); | 450 profile_path = GetProfilePath(kIEProfileName); |
453 } | 451 } |
454 return profile_path; | 452 return profile_path; |
455 } | 453 } |
456 | 454 |
457 FilePath GetTestDataFolder() { | 455 FilePath GetTestDataFolder() { |
458 FilePath test_dir; | 456 FilePath test_dir; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 bool wait) { | 666 bool wait) { |
669 bool result = true; | 667 bool result = true; |
670 base::NamedProcessIterator iter(executable_name, NULL); | 668 base::NamedProcessIterator iter(executable_name, NULL); |
671 while (const base::ProcessEntry* entry = iter.NextProcessEntry()) { | 669 while (const base::ProcessEntry* entry = iter.NextProcessEntry()) { |
672 result &= base::KillProcessById(entry->pid(), exit_code, wait); | 670 result &= base::KillProcessById(entry->pid(), exit_code, wait); |
673 } | 671 } |
674 return result; | 672 return result; |
675 } | 673 } |
676 | 674 |
677 } // namespace chrome_frame_test | 675 } // namespace chrome_frame_test |
OLD | NEW |