| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "mojo/edk/js/mojo_runner_delegate.h" | 22 #include "mojo/edk/js/mojo_runner_delegate.h" |
| 23 #include "mojo/edk/js/tests/js_to_cpp.mojom.h" | 23 #include "mojo/edk/js/tests/js_to_cpp.mojom.h" |
| 24 #include "mojo/edk/test/test_utils.h" | 24 #include "mojo/edk/test/test_utils.h" |
| 25 #include "mojo/public/cpp/bindings/binding.h" | 25 #include "mojo/public/cpp/bindings/binding.h" |
| 26 #include "mojo/public/cpp/system/core.h" | 26 #include "mojo/public/cpp/system/core.h" |
| 27 #include "mojo/public/cpp/system/macros.h" | 27 #include "mojo/public/cpp/system/macros.h" |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 29 | 29 |
| 30 namespace mojo { | 30 namespace mojo { |
| 31 namespace edk { | 31 namespace edk { |
| 32 namespace js { |
| 32 | 33 |
| 33 // Global value updated by some checks to prevent compilers from optimizing | 34 // Global value updated by some checks to prevent compilers from optimizing |
| 34 // reads out of existence. | 35 // reads out of existence. |
| 35 uint32_t g_waste_accumulator = 0; | 36 uint32_t g_waste_accumulator = 0; |
| 36 | 37 |
| 37 namespace { | 38 namespace { |
| 38 | 39 |
| 39 // Negative numbers with different values in each byte, the last of | 40 // Negative numbers with different values in each byte, the last of |
| 40 // which can survive promotion to double and back. | 41 // which can survive promotion to double and back. |
| 41 const int8_t kExpectedInt8Value = -65; | 42 const int8_t kExpectedInt8Value = -65; |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 RunTest("mojo/edk/js/tests/js_to_cpp_tests", &cpp_side_connection); | 434 RunTest("mojo/edk/js/tests/js_to_cpp_tests", &cpp_side_connection); |
| 434 EXPECT_TRUE(cpp_side_connection.DidSucceed()); | 435 EXPECT_TRUE(cpp_side_connection.DidSucceed()); |
| 435 } | 436 } |
| 436 | 437 |
| 437 TEST_F(JsToCppTest, BackPointer) { | 438 TEST_F(JsToCppTest, BackPointer) { |
| 438 BackPointerCppSideConnection cpp_side_connection; | 439 BackPointerCppSideConnection cpp_side_connection; |
| 439 RunTest("mojo/edk/js/tests/js_to_cpp_tests", &cpp_side_connection); | 440 RunTest("mojo/edk/js/tests/js_to_cpp_tests", &cpp_side_connection); |
| 440 EXPECT_TRUE(cpp_side_connection.DidSucceed()); | 441 EXPECT_TRUE(cpp_side_connection.DidSucceed()); |
| 441 } | 442 } |
| 442 | 443 |
| 444 } // namespace js |
| 443 } // namespace edk | 445 } // namespace edk |
| 444 } // namespace mojo | 446 } // namespace mojo |
| OLD | NEW |