Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: mojo/common/test/test_utils_win.cc

Issue 253413004: Enable mojo js tests which depend on mojom.js files in gen/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/common/test/test_utils_posix.cc ('k') | mojo/mojo.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « mojo/common/test/test_utils_posix.cc ('k') | mojo/mojo.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698