Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sandbox/linux/syscall_broker/broker_process.h" | 5 #include "sandbox/linux/syscall_broker/broker_process.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <poll.h> | 9 #include <poll.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 482 // Don't do anything here, so that ASSERT works in the subfunction as | 482 // Don't do anything here, so that ASSERT works in the subfunction as |
| 483 // expected. | 483 // expected. |
| 484 } | 484 } |
| 485 | 485 |
| 486 TEST(BrokerProcess, OpenComplexFlagsNoClientCheck) { | 486 TEST(BrokerProcess, OpenComplexFlagsNoClientCheck) { |
| 487 TestOpenComplexFlags(false /* fast_check_in_client */); | 487 TestOpenComplexFlags(false /* fast_check_in_client */); |
| 488 // Don't do anything here, so that ASSERT works in the subfunction as | 488 // Don't do anything here, so that ASSERT works in the subfunction as |
| 489 // expected. | 489 // expected. |
| 490 } | 490 } |
| 491 | 491 |
| 492 #if defined(OS_LINUX) | |
|
mdempsky
2016/03/24 22:27:30
The entire sandbox/linux directory is OS_LINUX-spe
| |
| 493 // Flaky on Linux NG bots: https://crbug.com/595199. | |
| 494 #define MAYBE_RecvMsgDescriptorLeak DISABLED_RecvMsgDescriptorLeak | |
| 495 #else | |
| 496 #define MAYBE_RecvMsgDescriptorLeak RecvMsgDescriptorLeak | |
| 497 #endif | |
| 498 | |
| 492 // We need to allow noise because the broker will log when it receives our | 499 // We need to allow noise because the broker will log when it receives our |
| 493 // bogus IPCs. | 500 // bogus IPCs. |
| 494 SANDBOX_TEST_ALLOW_NOISE(BrokerProcess, RecvMsgDescriptorLeak) { | 501 SANDBOX_TEST_ALLOW_NOISE(BrokerProcess, MAYBE_RecvMsgDescriptorLeak) { |
| 495 // Android creates a socket on first use of the LOG call. | 502 // Android creates a socket on first use of the LOG call. |
| 496 // We need to ensure this socket is open before we | 503 // We need to ensure this socket is open before we |
| 497 // begin the test. | 504 // begin the test. |
| 498 LOG(INFO) << "Ensure Android LOG socket is allocated"; | 505 LOG(INFO) << "Ensure Android LOG socket is allocated"; |
| 499 | 506 |
| 500 // Find the four lowest available file descriptors. | 507 // Find the four lowest available file descriptors. |
| 501 int available_fds[4]; | 508 int available_fds[4]; |
| 502 SANDBOX_ASSERT(0 == pipe(available_fds)); | 509 SANDBOX_ASSERT(0 == pipe(available_fds)); |
| 503 SANDBOX_ASSERT(0 == pipe(available_fds + 2)); | 510 SANDBOX_ASSERT(0 == pipe(available_fds + 2)); |
| 504 | 511 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 649 ssize_t len = HANDLE_EINTR(read(fd_check, buf, sizeof(buf))); | 656 ssize_t len = HANDLE_EINTR(read(fd_check, buf, sizeof(buf))); |
| 650 | 657 |
| 651 ASSERT_EQ(len, static_cast<ssize_t>(sizeof(kTestText))); | 658 ASSERT_EQ(len, static_cast<ssize_t>(sizeof(kTestText))); |
| 652 ASSERT_EQ(memcmp(kTestText, buf, sizeof(kTestText)), 0); | 659 ASSERT_EQ(memcmp(kTestText, buf, sizeof(kTestText)), 0); |
| 653 } | 660 } |
| 654 } | 661 } |
| 655 | 662 |
| 656 } // namespace syscall_broker | 663 } // namespace syscall_broker |
| 657 | 664 |
| 658 } // namespace sandbox | 665 } // namespace sandbox |
| OLD | NEW |