OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/common/test/test_utils.h" | 5 #include "mojo/common/test/test_utils.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
| 9 #include "base/base_paths.h" |
| 10 #include "base/path_service.h" |
| 11 #include "base/strings/string_util.h" |
9 #include "mojo/embedder/platform_handle.h" | 12 #include "mojo/embedder/platform_handle.h" |
10 | 13 |
11 namespace mojo { | 14 namespace mojo { |
12 namespace test { | 15 namespace test { |
13 | 16 |
14 bool BlockingWrite(const embedder::PlatformHandle& handle, | 17 bool BlockingWrite(const embedder::PlatformHandle& handle, |
15 const void* buffer, | 18 const void* buffer, |
16 size_t bytes_to_write, | 19 size_t bytes_to_write, |
17 size_t* bytes_written) { | 20 size_t* bytes_written) { |
18 OVERLAPPED overlapped = { 0 }; | 21 OVERLAPPED overlapped = { 0 }; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 TRUE)) { | 72 TRUE)) { |
70 *bytes_read = 0; | 73 *bytes_read = 0; |
71 return true; | 74 return true; |
72 } | 75 } |
73 } | 76 } |
74 | 77 |
75 *bytes_read = bytes_read_dword; | 78 *bytes_read = bytes_read_dword; |
76 return true; | 79 return true; |
77 } | 80 } |
78 | 81 |
| 82 base::FilePath GetFilePathForJSResource(const std::string& path) { |
| 83 std::string binding_path = "gen/" + path + ".js"; |
| 84 base::ReplaceChars(binding_path, "//", "\\", &binding_path); |
| 85 base::FilePath exe_dir; |
| 86 PathService::Get(base::DIR_EXE, &exe_dir); |
| 87 return exe_dir.AppendASCII(binding_path); |
| 88 } |
| 89 |
79 } // namespace test | 90 } // namespace test |
80 } // namespace mojo | 91 } // namespace mojo |
OLD | NEW |