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 "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "chrome/browser/extensions/api/dns/host_resolver_wrapper.h" | 8 #include "chrome/browser/extensions/api/dns/host_resolver_wrapper.h" |
9 #include "chrome/browser/extensions/api/dns/mock_host_resolver_creator.h" | 9 #include "chrome/browser/extensions/api/dns/mock_host_resolver_creator.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 virtual ~SocketPpapiTest() { | 66 virtual ~SocketPpapiTest() { |
67 } | 67 } |
68 | 68 |
69 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 69 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
70 SocketApiTest::SetUpCommandLine(command_line); | 70 SocketApiTest::SetUpCommandLine(command_line); |
71 // TODO(yzshen): It is better to use switches::kEnablePepperTesting. | 71 // TODO(yzshen): It is better to use switches::kEnablePepperTesting. |
72 // However, that requires adding a new DEPS entry. Considering that we are | 72 // However, that requires adding a new DEPS entry. Considering that we are |
73 // going to move the Pepper API tests to a new place, use a string literal | 73 // going to move the Pepper API tests to a new place, use a string literal |
74 // for now. | 74 // for now. |
75 command_line->AppendSwitch("enable-pepper-testing"); | 75 command_line->AppendSwitch("enable-pepper-testing"); |
| 76 } |
| 77 |
| 78 virtual void SetUpOnMainThread() OVERRIDE { |
| 79 SocketApiTest::SetUpOnMainThread(); |
76 | 80 |
77 PathService::Get(chrome::DIR_GEN_TEST_DATA, &app_dir_); | 81 PathService::Get(chrome::DIR_GEN_TEST_DATA, &app_dir_); |
78 app_dir_ = app_dir_.AppendASCII("ppapi/tests/extensions/socket/newlib"); | 82 app_dir_ = app_dir_.AppendASCII("ppapi/tests/extensions/socket/newlib"); |
79 } | 83 } |
80 | 84 |
81 protected: | 85 protected: |
82 void LaunchTestingApp() { | 86 void LaunchTestingApp() { |
83 const Extension* extension = LoadExtension(app_dir_); | 87 const Extension* extension = LoadExtension(app_dir_); |
84 ASSERT_TRUE(extension); | 88 ASSERT_TRUE(extension); |
85 | 89 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 352 |
349 LaunchTestingApp(); | 353 LaunchTestingApp(); |
350 | 354 |
351 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 355 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
352 listener.Reply( | 356 listener.Reply( |
353 base::StringPrintf("multicast:%s:%d", kHostname.c_str(), kPort)); | 357 base::StringPrintf("multicast:%s:%d", kHostname.c_str(), kPort)); |
354 | 358 |
355 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 359 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
356 } | 360 } |
357 #endif | 361 #endif |
OLD | NEW |