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

Side by Side Diff: mojo/public/cpp/bindings/tests/validation_unittest.cc

Issue 1410053006: Move third_party/mojo/src/mojo/public to mojo/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 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
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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "mojo/message_pump/message_pump_mojo.h" 12 #include "mojo/message_pump/message_pump_mojo.h"
13 #include "mojo/public/c/system/macros.h"
14 #include "mojo/public/cpp/bindings/binding.h"
15 #include "mojo/public/cpp/bindings/interface_ptr.h"
16 #include "mojo/public/cpp/bindings/lib/connector.h"
17 #include "mojo/public/cpp/bindings/lib/filter_chain.h"
18 #include "mojo/public/cpp/bindings/lib/message_header_validator.h"
19 #include "mojo/public/cpp/bindings/lib/router.h"
20 #include "mojo/public/cpp/bindings/lib/validation_errors.h"
21 #include "mojo/public/cpp/bindings/message.h"
22 #include "mojo/public/cpp/bindings/tests/validation_test_input_parser.h"
23 #include "mojo/public/cpp/system/core.h"
24 #include "mojo/public/cpp/test_support/test_support.h"
25 #include "mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom .h"
13 #include "testing/gtest/include/gtest/gtest.h" 26 #include "testing/gtest/include/gtest/gtest.h"
14 #include "third_party/mojo/src/mojo/public/c/system/macros.h"
15 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h"
16 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h"
17 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/connector.h"
18 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/filter_chain.h"
19 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/message_header_valid ator.h"
20 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/router.h"
21 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/validation_errors.h"
22 #include "third_party/mojo/src/mojo/public/cpp/bindings/message.h"
23 #include "third_party/mojo/src/mojo/public/cpp/bindings/tests/validation_test_in put_parser.h"
24 #include "third_party/mojo/src/mojo/public/cpp/system/core.h"
25 #include "third_party/mojo/src/mojo/public/cpp/test_support/test_support.h"
26 #include "third_party/mojo/src/mojo/public/interfaces/bindings/tests/validation_ test_interfaces.mojom.h"
27 27
28 namespace mojo { 28 namespace mojo {
29 namespace test { 29 namespace test {
30 namespace { 30 namespace {
31 31
32 template <typename T> 32 template <typename T>
33 void Append(std::vector<uint8_t>* data_vector, T data) { 33 void Append(std::vector<uint8_t>* data_vector, T data) {
34 size_t pos = data_vector->size(); 34 size_t pos = data_vector->size();
35 data_vector->resize(pos + sizeof(T)); 35 data_vector->resize(pos + sizeof(T));
36 memcpy(&(*data_vector)[pos], &data, sizeof(T)); 36 memcpy(&(*data_vector)[pos], &data, sizeof(T));
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 static_cast<StructWithEnum::EnumWithin>(2))); 471 static_cast<StructWithEnum::EnumWithin>(2)));
472 EXPECT_TRUE(StructWithEnum::EnumWithin_IsValidValue( 472 EXPECT_TRUE(StructWithEnum::EnumWithin_IsValidValue(
473 static_cast<StructWithEnum::EnumWithin>(3))); 473 static_cast<StructWithEnum::EnumWithin>(3)));
474 EXPECT_FALSE(StructWithEnum::EnumWithin_IsValidValue( 474 EXPECT_FALSE(StructWithEnum::EnumWithin_IsValidValue(
475 static_cast<StructWithEnum::EnumWithin>(4))); 475 static_cast<StructWithEnum::EnumWithin>(4)));
476 } 476 }
477 477
478 } // namespace 478 } // namespace
479 } // namespace test 479 } // namespace test
480 } // namespace mojo 480 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/validation_test_input_parser.cc ('k') | mojo/public/cpp/bindings/tests/versioning_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698