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

Side by Side Diff: mojo/public/cpp/system/tests/core_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
« no previous file with comments | « mojo/public/c/system/tests/data_pipe_unittest.cc ('k') | no next file » | 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 // This file tests the C++ Mojo system core wrappers. 5 // This file tests the C++ Mojo system core wrappers.
6 // TODO(vtl): Maybe rename "CoreCppTest" -> "CoreTest" if/when this gets 6 // TODO(vtl): Maybe rename "CoreCppTest" -> "CoreTest" if/when this gets
7 // compiled into a different binary from the C API tests. 7 // compiled into a different binary from the C API tests.
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 537
538 { 538 {
539 WaitManyResult wmr(MOJO_RESULT_FAILED_PRECONDITION, 5u); 539 WaitManyResult wmr(MOJO_RESULT_FAILED_PRECONDITION, 5u);
540 EXPECT_TRUE(wmr.IsIndexValid()); 540 EXPECT_TRUE(wmr.IsIndexValid());
541 EXPECT_TRUE(wmr.AreSignalsStatesValid()); 541 EXPECT_TRUE(wmr.AreSignalsStatesValid());
542 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, wmr.result); 542 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, wmr.result);
543 EXPECT_EQ(5u, wmr.index); 543 EXPECT_EQ(5u, wmr.index);
544 } 544 }
545 } 545 }
546 546
547 // TODO(ncbray): enable this test once NaCl supports the corresponding APIs. 547 TEST(CoreCppTest, DataPipe) {
548 #ifdef __native_client__
549 #define MAYBE_DataPipe DISABLED_DataPipe
550 #else
551 #define MAYBE_DataPipe DataPipe
552 #endif
553 TEST(CoreCppTest, MAYBE_DataPipe) {
554 ScopedDataPipeProducerHandle ph; 548 ScopedDataPipeProducerHandle ph;
555 ScopedDataPipeConsumerHandle ch; 549 ScopedDataPipeConsumerHandle ch;
556 550
557 ASSERT_EQ(MOJO_RESULT_OK, CreateDataPipe(nullptr, &ph, &ch)); 551 ASSERT_EQ(MOJO_RESULT_OK, CreateDataPipe(nullptr, &ph, &ch));
558 ASSERT_TRUE(ph.get().is_valid()); 552 ASSERT_TRUE(ph.get().is_valid());
559 ASSERT_TRUE(ch.get().is_valid()); 553 ASSERT_TRUE(ch.get().is_valid());
560 554
561 uint32_t read_threshold = 123u; 555 uint32_t read_threshold = 123u;
562 EXPECT_EQ(MOJO_RESULT_OK, 556 EXPECT_EQ(MOJO_RESULT_OK,
563 GetDataPipeConsumerOptions(ch.get(), &read_threshold)); 557 GetDataPipeConsumerOptions(ch.get(), &read_threshold));
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 // Close the producer. 638 // Close the producer.
645 ph.reset(); 639 ph.reset();
646 640
647 // Waiting for "read" should now fail. 641 // Waiting for "read" should now fail.
648 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, 642 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
649 Wait(ch.get(), MOJO_HANDLE_SIGNAL_READ_THRESHOLD, 1000, nullptr)); 643 Wait(ch.get(), MOJO_HANDLE_SIGNAL_READ_THRESHOLD, 1000, nullptr));
650 } 644 }
651 645
652 } // namespace 646 } // namespace
653 } // namespace mojo 647 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/c/system/tests/data_pipe_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698