forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert PepperTCPSocketMessageFilter to use the mojo host resolver.
Bug: 821021 Cq-Include-Trybots: luci.chromium.try:linux_mojo Change-Id: Ic6422ecc5f2298c25a8720a7dfeac17114ede0ad Reviewed-on: https://chromium-review.googlesource.com/1173492 Commit-Queue: John Abd-El-Malek <jam@chromium.org> Reviewed-by: Matt Menke <mmenke@chromium.org> Reviewed-by: Will Harris <wfh@chromium.org> Cr-Commit-Position: refs/heads/master@{#583419}
- Loading branch information
John Abd-El-Malek
authored and
Commit Bot
committed
Aug 15, 2018
1 parent
00fe5a6
commit e0903d1
Showing
10 changed files
with
188 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2018 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "ppapi/tests/test_tcp_socket_private_crash.h" | ||
|
||
#include <stddef.h> | ||
#include <stdlib.h> | ||
|
||
#include <new> | ||
|
||
#include "ppapi/cpp/private/tcp_socket_private.h" | ||
#include "ppapi/tests/test_utils.h" | ||
#include "ppapi/tests/testing_instance.h" | ||
|
||
REGISTER_TEST_CASE(TCPSocketPrivateCrash); | ||
|
||
TestTCPSocketPrivateCrash::TestTCPSocketPrivateCrash(TestingInstance* instance) | ||
: TestCase(instance) {} | ||
|
||
bool TestTCPSocketPrivateCrash::Init() { | ||
return pp::TCPSocketPrivate::IsAvailable(); | ||
} | ||
|
||
void TestTCPSocketPrivateCrash::RunTests(const std::string& filter) { | ||
// No need to run this test with the various callback types since that's | ||
// orthogonal from the functionality being tested. It would also make the | ||
// test more complicated because it would have to keep watching the network | ||
// process restart and telling it to crash again on crash.com. | ||
RUN_TEST(Resolve, filter); | ||
} | ||
|
||
std::string TestTCPSocketPrivateCrash::TestResolve() { | ||
pp::TCPSocketPrivate socket(instance_); | ||
|
||
TestCompletionCallback cb(instance_->pp_instance(), callback_type()); | ||
|
||
std::string host("crash.com"); | ||
cb.WaitForResult(socket.Connect(host.c_str(), 80, cb.GetCallback())); | ||
ASSERT_EQ(PP_ERROR_FAILED, cb.result()); | ||
|
||
socket.Disconnect(); | ||
|
||
PASS(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2018 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef PPAPI_TESTS_TEST_TCP_SOCKET_PRIVATE_CRASH_H_ | ||
#define PPAPI_TESTS_TEST_TCP_SOCKET_PRIVATE_CRASH_H_ | ||
|
||
#include <string> | ||
|
||
#include "ppapi/c/pp_stdint.h" | ||
#include "ppapi/tests/test_case.h" | ||
|
||
class TestTCPSocketPrivateCrash : public TestCase { | ||
public: | ||
explicit TestTCPSocketPrivateCrash(TestingInstance* instance); | ||
|
||
// TestCase implementation. | ||
virtual bool Init(); | ||
virtual void RunTests(const std::string& filter); | ||
|
||
private: | ||
std::string TestResolve(); | ||
}; | ||
|
||
#endif // PPAPI_TESTS_TEST_TCP_SOCKET_PRIVATE_CRASH_H_ |
Oops, something went wrong.