OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "win8/test/metro_registration_helper.h" | 5 #include "win8/test/metro_registration_helper.h" |
6 | 6 |
7 #include <shlobj.h> | 7 #include <shlobj.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // Perform the registration by invoking test_registrar.exe. | 52 // Perform the registration by invoking test_registrar.exe. |
53 base::CommandLine register_command(registrar); | 53 base::CommandLine register_command(registrar); |
54 register_command.AppendArg("/RegServer"); | 54 register_command.AppendArg("/RegServer"); |
55 | 55 |
56 base::Process register_process = | 56 base::Process register_process = |
57 base::LaunchProcess(register_command.GetCommandLineString(), | 57 base::LaunchProcess(register_command.GetCommandLineString(), |
58 base::LaunchOptions()); | 58 base::LaunchOptions()); |
59 if (register_process.IsValid()) { | 59 if (register_process.IsValid()) { |
60 int ret = 0; | 60 int ret = 0; |
61 if (base::WaitForExitCodeWithTimeout( | 61 if (register_process.WaitForExitWithTimeout( |
62 register_process.Handle(), &ret, | 62 base::TimeDelta::FromSeconds(kRegistrationTimeoutSeconds), &ret)) { |
63 base::TimeDelta::FromSeconds(kRegistrationTimeoutSeconds))) { | |
64 if (ret == 0) { | 63 if (ret == 0) { |
65 return true; | 64 return true; |
66 } else { | 65 } else { |
67 LOG(ERROR) << "Win8 registration using " | 66 LOG(ERROR) << "Win8 registration using " |
68 << register_command.GetCommandLineString() | 67 << register_command.GetCommandLineString() |
69 << " failed with error code " << ret; | 68 << " failed with error code " << ret; |
70 } | 69 } |
71 } else { | 70 } else { |
72 LOG(ERROR) << "Win8 registration using " | 71 LOG(ERROR) << "Win8 registration using " |
73 << register_command.GetCommandLineString() << " timed out."; | 72 << register_command.GetCommandLineString() << " timed out."; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 std::vector<base::string16> choices; | 123 std::vector<base::string16> choices; |
125 OpenWithDialogController controller; | 124 OpenWithDialogController controller; |
126 HRESULT hr = controller.RunSynchronously( | 125 HRESULT hr = controller.RunSynchronously( |
127 NULL, kDefaultBrowserProtocol, win8::test::kDefaultTestExeName, &choices); | 126 NULL, kDefaultBrowserProtocol, win8::test::kDefaultTestExeName, &choices); |
128 LOG_IF(ERROR, FAILED(hr)) << std::hex << hr; | 127 LOG_IF(ERROR, FAILED(hr)) << std::hex << hr; |
129 DCHECK(IsTestDefaultForProtocol(kDefaultBrowserProtocol)); | 128 DCHECK(IsTestDefaultForProtocol(kDefaultBrowserProtocol)); |
130 return SUCCEEDED(hr); | 129 return SUCCEEDED(hr); |
131 } | 130 } |
132 | 131 |
133 } // namespace win8 | 132 } // namespace win8 |
OLD | NEW |