From 184f354ddeff66784515ddbbee9c46355cadab6a Mon Sep 17 00:00:00 2001 From: jamesr Date: Thu, 13 Nov 2014 15:36:42 -0800 Subject: Update mojo sdk to rev afb4440fd5a10cba980878c326180b7ad7960480 TBR=jam@chromium.org Review URL: https://codereview.chromium.org/728553002 Cr-Commit-Position: refs/heads/master@{#304114} --- mojo/edk/test/BUILD.gn | 2 ++ mojo/edk/test/multiprocess_test_helper.cc | 4 ++-- mojo/edk/test/multiprocess_test_helper.h | 3 +-- mojo/edk/test/run_all_unittests.cc | 3 +-- mojo/edk/test/test_support_impl.cc | 3 +-- mojo/edk/test/test_utils_win.cc | 39 +++++++++++-------------------- 6 files changed, 20 insertions(+), 34 deletions(-) (limited to 'mojo/edk/test') diff --git a/mojo/edk/test/BUILD.gn b/mojo/edk/test/BUILD.gn index e5d53b5..38a631b 100644 --- a/mojo/edk/test/BUILD.gn +++ b/mojo/edk/test/BUILD.gn @@ -56,6 +56,8 @@ source_set("test_support_impl") { testonly = true deps = [ "//base", + "//base/test:test_support", + "//mojo/public/c/test_support", ] sources = [ diff --git a/mojo/edk/test/multiprocess_test_helper.cc b/mojo/edk/test/multiprocess_test_helper.cc index 02367d6..30aa0be 100644 --- a/mojo/edk/test/multiprocess_test_helper.cc +++ b/mojo/edk/test/multiprocess_test_helper.cc @@ -60,8 +60,8 @@ int MultiprocessTestHelper::WaitForChildShutdown() { CHECK_NE(test_child_handle_, base::kNullProcessHandle); int rv = -1; - CHECK(base::WaitForExitCodeWithTimeout( - test_child_handle_, &rv, TestTimeouts::action_timeout())); + CHECK(base::WaitForExitCodeWithTimeout(test_child_handle_, &rv, + TestTimeouts::action_timeout())); base::CloseProcessHandle(test_child_handle_); test_child_handle_ = base::kNullProcessHandle; return rv; diff --git a/mojo/edk/test/multiprocess_test_helper.h b/mojo/edk/test/multiprocess_test_helper.h index 6b2713f..d131460 100644 --- a/mojo/edk/test/multiprocess_test_helper.h +++ b/mojo/edk/test/multiprocess_test_helper.h @@ -7,8 +7,7 @@ #include -#include "base/basictypes.h" -#include "base/compiler_specific.h" +#include "base/macros.h" #include "base/process/process_handle.h" #include "base/test/multiprocess_test.h" #include "base/test/test_timeouts.h" diff --git a/mojo/edk/test/run_all_unittests.cc b/mojo/edk/test/run_all_unittests.cc index c66ea50..166a73e 100644 --- a/mojo/edk/test/run_all_unittests.cc +++ b/mojo/edk/test/run_all_unittests.cc @@ -21,7 +21,6 @@ int main(int argc, char** argv) { mojo::test::TestSupport::Init(new mojo::test::TestSupportImpl()); return base::LaunchUnitTests( - argc, - argv, + argc, argv, base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); } diff --git a/mojo/edk/test/test_support_impl.cc b/mojo/edk/test/test_support_impl.cc index 2a86331..fae3a8f 100644 --- a/mojo/edk/test/test_support_impl.cc +++ b/mojo/edk/test/test_support_impl.cc @@ -56,8 +56,7 @@ FILE* TestSupportImpl::OpenSourceRootRelativeFile(const char* relative_path) { char** TestSupportImpl::EnumerateSourceRootRelativeDirectory( const char* relative_path) { std::vector names; - base::FileEnumerator e(ResolveSourceRootRelativePath(relative_path), - false, + base::FileEnumerator e(ResolveSourceRootRelativePath(relative_path), false, base::FileEnumerator::FILES); for (base::FilePath name = e.Next(); !name.empty(); name = e.Next()) names.push_back(name.BaseName().AsUTF8Unsafe()); diff --git a/mojo/edk/test/test_utils_win.cc b/mojo/edk/test/test_utils_win.cc index 5d5b942..2387945 100644 --- a/mojo/edk/test/test_utils_win.cc +++ b/mojo/edk/test/test_utils_win.cc @@ -23,14 +23,11 @@ bool BlockingWrite(const embedder::PlatformHandle& handle, OVERLAPPED overlapped = {0}; DWORD bytes_written_dword = 0; - if (!WriteFile(handle.handle, - buffer, - static_cast(bytes_to_write), - &bytes_written_dword, - &overlapped)) { + if (!WriteFile(handle.handle, buffer, static_cast(bytes_to_write), + &bytes_written_dword, &overlapped)) { if (GetLastError() != ERROR_IO_PENDING || - !GetOverlappedResult( - handle.handle, &overlapped, &bytes_written_dword, TRUE)) { + !GetOverlappedResult(handle.handle, &overlapped, &bytes_written_dword, + TRUE)) { return false; } } @@ -46,14 +43,11 @@ bool BlockingRead(const embedder::PlatformHandle& handle, OVERLAPPED overlapped = {0}; DWORD bytes_read_dword = 0; - if (!ReadFile(handle.handle, - buffer, - static_cast(buffer_size), - &bytes_read_dword, - &overlapped)) { + if (!ReadFile(handle.handle, buffer, static_cast(buffer_size), + &bytes_read_dword, &overlapped)) { if (GetLastError() != ERROR_IO_PENDING || - !GetOverlappedResult( - handle.handle, &overlapped, &bytes_read_dword, TRUE)) { + !GetOverlappedResult(handle.handle, &overlapped, &bytes_read_dword, + TRUE)) { return false; } } @@ -69,18 +63,15 @@ bool NonBlockingRead(const embedder::PlatformHandle& handle, OVERLAPPED overlapped = {0}; DWORD bytes_read_dword = 0; - if (!ReadFile(handle.handle, - buffer, - static_cast(buffer_size), - &bytes_read_dword, - &overlapped)) { + if (!ReadFile(handle.handle, buffer, static_cast(buffer_size), + &bytes_read_dword, &overlapped)) { if (GetLastError() != ERROR_IO_PENDING) return false; CancelIo(handle.handle); - if (!GetOverlappedResult( - handle.handle, &overlapped, &bytes_read_dword, TRUE)) { + if (!GetOverlappedResult(handle.handle, &overlapped, &bytes_read_dword, + TRUE)) { *bytes_read = 0; return true; } @@ -97,11 +88,7 @@ embedder::ScopedPlatformHandle PlatformHandleFromFILE(base::ScopedFILE fp) { PCHECK(DuplicateHandle( GetCurrentProcess(), reinterpret_cast(_get_osfhandle(_fileno(fp.get()))), - GetCurrentProcess(), - &rv, - 0, - TRUE, - DUPLICATE_SAME_ACCESS)) + GetCurrentProcess(), &rv, 0, TRUE, DUPLICATE_SAME_ACCESS)) << "DuplicateHandle"; return embedder::ScopedPlatformHandle(embedder::PlatformHandle(rv)); } -- cgit v1.1