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

Side by Side Diff: mojo/public/c/system/tests/data_pipe_unittest.cc

Issue 2107893003: Remove some #ifdef __native_client__ on tests. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // This file tests the C data pipe API (the functions declared in 5 // This file tests the C data pipe API (the functions declared in
6 // mojo/public/c/system/data_pipe.h). 6 // mojo/public/c/system/data_pipe.h).
7 7
8 #include "mojo/public/c/system/data_pipe.h" 8 #include "mojo/public/c/system/data_pipe.h"
9 9
10 #include <string.h> 10 #include <string.h>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 MojoReadData(MOJO_HANDLE_INVALID, buffer, &buffer_size, 56 MojoReadData(MOJO_HANDLE_INVALID, buffer, &buffer_size,
57 MOJO_READ_DATA_FLAG_NONE)); 57 MOJO_READ_DATA_FLAG_NONE));
58 const void* read_pointer = nullptr; 58 const void* read_pointer = nullptr;
59 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, 59 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
60 MojoBeginReadData(MOJO_HANDLE_INVALID, &read_pointer, &buffer_size, 60 MojoBeginReadData(MOJO_HANDLE_INVALID, &read_pointer, &buffer_size,
61 MOJO_READ_DATA_FLAG_NONE)); 61 MOJO_READ_DATA_FLAG_NONE));
62 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, 62 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
63 MojoEndReadData(MOJO_HANDLE_INVALID, 1u)); 63 MojoEndReadData(MOJO_HANDLE_INVALID, 1u));
64 } 64 }
65 65
66 // TODO(ncbray): enable this test once NaCl supports the corresponding APIs. 66 TEST(DataPipeTest, Basic) {
67 #ifdef __native_client__
68 #define MAYBE_Basic DISABLED_Basic
69 #else
70 #define MAYBE_Basic Basic
71 #endif
72 TEST(DataPipeTest, MAYBE_Basic) {
73 MojoHandle hp = MOJO_HANDLE_INVALID; 67 MojoHandle hp = MOJO_HANDLE_INVALID;
74 MojoHandle hc = MOJO_HANDLE_INVALID; 68 MojoHandle hc = MOJO_HANDLE_INVALID;
75 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateDataPipe(nullptr, &hp, &hc)); 69 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateDataPipe(nullptr, &hp, &hc));
76 EXPECT_NE(hp, MOJO_HANDLE_INVALID); 70 EXPECT_NE(hp, MOJO_HANDLE_INVALID);
77 EXPECT_NE(hc, MOJO_HANDLE_INVALID); 71 EXPECT_NE(hc, MOJO_HANDLE_INVALID);
78 EXPECT_NE(hp, hc); 72 EXPECT_NE(hp, hc);
79 73
80 // Both handles should have the correct rights. 74 // Both handles should have the correct rights.
81 MojoHandleRights rights = MOJO_HANDLE_RIGHT_NONE; 75 MojoHandleRights rights = MOJO_HANDLE_RIGHT_NONE;
82 EXPECT_EQ(MOJO_RESULT_OK, MojoGetRights(hp, &rights)); 76 EXPECT_EQ(MOJO_RESULT_OK, MojoGetRights(hp, &rights));
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 EXPECT_EQ(MOJO_RESULT_OK, 431 EXPECT_EQ(MOJO_RESULT_OK,
438 MojoWait(hc, MOJO_HANDLE_SIGNAL_READ_THRESHOLD, 0, nullptr)); 432 MojoWait(hc, MOJO_HANDLE_SIGNAL_READ_THRESHOLD, 0, nullptr));
439 433
440 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(hp)); 434 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(hp));
441 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(hc)); 435 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(hc));
442 } 436 }
443 437
444 // TODO(vtl): Add multi-threaded tests. 438 // TODO(vtl): Add multi-threaded tests.
445 439
446 } // namespace 440 } // namespace
OLDNEW
« no previous file with comments | « mojo/public/c/system/tests/buffer_unittest.cc ('k') | mojo/public/cpp/system/tests/core_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698