Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(803)

Unified Diff: content/browser/worker_host/test/worker_browsertest.cc

Issue 11028111: Replace WorkerWebSocketHttpLayoutTest with WorkerTest.WebSocketSharedWorker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: just add copyright Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/data/websocket/websocket_shared_worker.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/worker_host/test/worker_browsertest.cc
diff --git a/content/browser/worker_host/test/worker_browsertest.cc b/content/browser/worker_host/test/worker_browsertest.cc
index 1e1913ed0d0de27c6f8a620e8962ff766906db7f..c37a1872cb91a8e841f859b9964005c54ec6b2da 100644
--- a/content/browser/worker_host/test/worker_browsertest.cc
+++ b/content/browser/worker_host/test/worker_browsertest.cc
@@ -23,6 +23,7 @@
#include "content/test/content_browser_test_utils.h"
#include "content/test/layout_browsertest.h"
#include "googleurl/src/gurl.h"
+#include "net/test/test_server.h"
using content::BrowserThread;
using content::WorkerServiceImpl;
@@ -221,37 +222,6 @@ IN_PROC_BROWSER_TEST_F(WorkerXHRHttpLayoutTest, Tests) {
RunHttpLayoutTest(kLayoutTestFiles[i]);
}
-class WorkerWebSocketHttpLayoutTest : public InProcessBrowserLayoutTest {
- public:
- WorkerWebSocketHttpLayoutTest() : InProcessBrowserLayoutTest(
- FilePath(),
- FilePath().AppendASCII("http").AppendASCII("tests").
- AppendASCII("websocket").AppendASCII("tests").AppendASCII("hybi").
- AppendASCII("workers"),
- -1) {
- }
-};
-
-IN_PROC_BROWSER_TEST_F(WorkerWebSocketHttpLayoutTest, DISABLED_Tests) {
- static const char* kLayoutTestFiles[] = {
- "close-in-onmessage-crash.html",
- "close-in-shared-worker.html",
- "close-in-worker.html",
- "shared-worker-simple.html",
- "worker-handshake-challenge-randomness.html",
- "worker-simple.html"
- };
-
- FilePath websocket_test_dir;
- ASSERT_TRUE(PathService::Get(content::DIR_LAYOUT_TESTS, &websocket_test_dir));
-
- content::TestWebSocketServer websocket_server;
- ASSERT_TRUE(websocket_server.Start(websocket_test_dir));
-
- for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i)
- RunHttpLayoutTest(kLayoutTestFiles[i]);
-}
-
class WorkerTest : public content::ContentBrowserTest {
public:
WorkerTest() {}
@@ -480,3 +450,26 @@ IN_PROC_BROWSER_TEST_F(WorkerTest, DISABLED_QueuedSharedWorkerStartedFromOtherTa
ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab + 1));
}
+
+IN_PROC_BROWSER_TEST_F(WorkerTest, WebSocketSharedWorker) {
+ // Launch WebSocket server.
+ net::TestServer ws_server(net::TestServer::TYPE_WS,
+ net::TestServer::kLocalhost,
+ FilePath(FILE_PATH_LITERAL("net/data/websocket")));
+ ASSERT_TRUE(ws_server.Start());
+
+ // Generate test URL.
+ std::string scheme("http");
+ GURL::Replacements replacements;
+ replacements.SetSchemeStr(scheme);
+ GURL url = ws_server.GetURL(
+ "websocket_shared_worker.html").ReplaceComponents(replacements);
+
+ // Run test.
+ content::Shell* window = shell();
+ const string16 expected_title = ASCIIToUTF16("OK");
+ content::TitleWatcher title_watcher(window->web_contents(), expected_title);
+ content::NavigateToURL(window, url);
+ string16 final_title = title_watcher.WaitAndGetTitle();
+ EXPECT_EQ(expected_title, final_title);
+}
« no previous file with comments | « no previous file | net/data/websocket/websocket_shared_worker.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698