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

Side by Side Diff: mojo/public/tests/system_core_unittest.cc

Issue 73243002: Mojo: Trivial cleanup -- remove unneeded test fixture in test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « no previous file | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/public/system/core.h" 5 #include "mojo/public/system/core.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace mojo { 11 namespace mojo {
12 namespace { 12 namespace {
13 13
14 class SystemTest : public testing::Test { 14 TEST(SystemTest, Basic) {
15 };
16
17 TEST_F(SystemTest, Basic) {
18 Handle h_0; 15 Handle h_0;
19 MojoWaitFlags wf; 16 MojoWaitFlags wf;
20 char buffer[10] = { 0 }; 17 char buffer[10] = { 0 };
21 uint32_t buffer_size; 18 uint32_t buffer_size;
22 19
23 // The only handle that's guaranteed to be invalid is |kInvalidHandle|. 20 // The only handle that's guaranteed to be invalid is |kInvalidHandle|.
24 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, Close(kInvalidHandle)); 21 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, Close(kInvalidHandle));
25 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, 22 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
26 Wait(kInvalidHandle, MOJO_WAIT_FLAG_EVERYTHING, 1000000)); 23 Wait(kInvalidHandle, MOJO_WAIT_FLAG_EVERYTHING, 1000000));
27 h_0 = kInvalidHandle; 24 h_0 = kInvalidHandle;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, 92 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
96 Wait(h_1, MOJO_WAIT_FLAG_READABLE | MOJO_WAIT_FLAG_WRITABLE, 1000)); 93 Wait(h_1, MOJO_WAIT_FLAG_READABLE | MOJO_WAIT_FLAG_WRITABLE, 1000));
97 94
98 EXPECT_EQ(MOJO_RESULT_OK, Close(h_1)); 95 EXPECT_EQ(MOJO_RESULT_OK, Close(h_1));
99 } 96 }
100 97
101 // TODO(vtl): Add multi-threaded tests. 98 // TODO(vtl): Add multi-threaded tests.
102 99
103 } // namespace 100 } // namespace
104 } // namespace mojo 101 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698