| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/test/ui/ui_test.h" | 5 #include "chrome/test/ui/ui_test.h" |
| 6 | 6 |
| 7 #include "chrome/common/url_constants.h" | 7 #include "chrome/common/url_constants.h" |
| 8 #include "chrome/test/automation/proxy_launcher.h" | 8 #include "chrome/test/automation/proxy_launcher.h" |
| 9 | 9 |
| 10 // The named testing interface enables the use of a named socket for controlling | 10 // The named testing interface enables the use of a named socket for controlling |
| 11 // the browser. This eliminates the dependency that the browser must be forked | 11 // the browser. This eliminates the dependency that the browser must be forked |
| 12 // from the controlling process. | 12 // from the controlling process. |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 class NamedInterfaceTest : public UITest { | 15 class NamedInterfaceTest : public UITest { |
| 16 public: | 16 public: |
| 17 NamedInterfaceTest() { | 17 NamedInterfaceTest() { |
| 18 show_window_ = true; | 18 show_window_ = true; |
| 19 } | 19 } |
| 20 | 20 |
| 21 virtual ProxyLauncher *CreateProxyLauncher() { | 21 virtual ProxyLauncher *CreateProxyLauncher() { |
| 22 return new NamedProxyLauncher(true, true); | 22 return new NamedProxyLauncher(true, true); |
| 23 } | 23 } |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 // This test is flaky on Linux bots. http://crbug.com/66414 | |
| 27 #if defined(OS_LINUX) | |
| 28 #define MAYBE_BasicNamedInterface FLAKY_BasicNamedInterface | |
| 29 #else | |
| 30 #define MAYBE_BasicNamedInterface BasicNamedInterface | |
| 31 #endif | |
| 32 | |
| 33 // Basic sanity test for named testing interface which | 26 // Basic sanity test for named testing interface which |
| 34 // launches a browser instance that uses a named socket, then | 27 // launches a browser instance that uses a named socket, then |
| 35 // sends it some commands to open some tabs over that socket. | 28 // sends it some commands to open some tabs over that socket. |
| 36 TEST_F(NamedInterfaceTest, MAYBE_BasicNamedInterface) { | 29 TEST_F(NamedInterfaceTest, BasicNamedInterface) { |
| 37 scoped_refptr<BrowserProxy> browser_proxy( | 30 scoped_refptr<BrowserProxy> browser_proxy( |
| 38 automation()->GetBrowserWindow(0)); | 31 automation()->GetBrowserWindow(0)); |
| 39 ASSERT_TRUE(browser_proxy.get()); | 32 ASSERT_TRUE(browser_proxy.get()); |
| 40 | 33 |
| 41 for (int i = 0; i < 10; ++i) | 34 for (int i = 0; i < 10; ++i) |
| 42 ASSERT_TRUE(browser_proxy->AppendTab(GURL(chrome::kAboutBlankURL))); | 35 ASSERT_TRUE(browser_proxy->AppendTab(GURL(chrome::kAboutBlankURL))); |
| 43 } | 36 } |
| 44 | 37 |
| 45 // TODO(dtu): crosbug.com/8514: Write a test that makes sure you can disconnect, | 38 // TODO(dtu): crosbug.com/8514: Write a test that makes sure you can disconnect, |
| 46 // then reconnect with a new connection and continue automation. | 39 // then reconnect with a new connection and continue automation. |
| 47 | 40 |
| 48 } // namespace | 41 } // namespace |
| 49 | |
| OLD | NEW |