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

Side by Side Diff: content/browser/loader/async_resource_handler_browsertest.cc

Issue 1378123003: Adding SSL ETS Tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ets
Patch Set: Rebase. Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/browser/loader/async_resource_handler.h" 5 #include "content/browser/loader/async_resource_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return scoped_ptr<net::test_server::HttpResponse>(); 56 return scoped_ptr<net::test_server::HttpResponse>();
57 } 57 }
58 } 58 }
59 59
60 } // namespace 60 } // namespace
61 61
62 class AsyncResourceHandlerBrowserTest : public ContentBrowserTest { 62 class AsyncResourceHandlerBrowserTest : public ContentBrowserTest {
63 }; 63 };
64 64
65 IN_PROC_BROWSER_TEST_F(AsyncResourceHandlerBrowserTest, UploadProgress) { 65 IN_PROC_BROWSER_TEST_F(AsyncResourceHandlerBrowserTest, UploadProgress) {
66 net::test_server::EmbeddedTestServer* test_server = embedded_test_server(); 66 net::EmbeddedTestServer* test_server = embedded_test_server();
67 ASSERT_TRUE(test_server->InitializeAndWaitUntilReady()); 67 ASSERT_TRUE(test_server->Start());
68 test_server->RegisterRequestHandler( 68 test_server->RegisterRequestHandler(
69 base::Bind(&HandlePostAndRedirectURLs, kPostPath)); 69 base::Bind(&HandlePostAndRedirectURLs, kPostPath));
70 70
71 NavigateToURL(shell(), 71 NavigateToURL(shell(),
72 test_server->GetURL("/loader/async_resource_handler.html")); 72 test_server->GetURL("/loader/async_resource_handler.html"));
73 73
74 std::string js_result; 74 std::string js_result;
75 EXPECT_TRUE(ExecuteScriptAndExtractString( 75 EXPECT_TRUE(ExecuteScriptAndExtractString(
76 shell()->web_contents(), 76 shell()->web_contents(),
77 base::StringPrintf("WaitForAsyncXHR('%s', %" PRIuS ")", 77 base::StringPrintf("WaitForAsyncXHR('%s', %" PRIuS ")",
78 kPostPath, 78 kPostPath,
79 kPayloadSize), 79 kPayloadSize),
80 &js_result)); 80 &js_result));
81 EXPECT_EQ(js_result, "success"); 81 EXPECT_EQ(js_result, "success");
82 } 82 }
83 83
84 IN_PROC_BROWSER_TEST_F(AsyncResourceHandlerBrowserTest, 84 IN_PROC_BROWSER_TEST_F(AsyncResourceHandlerBrowserTest,
85 UploadProgressRedirect) { 85 UploadProgressRedirect) {
86 net::test_server::EmbeddedTestServer* test_server = embedded_test_server(); 86 net::EmbeddedTestServer* test_server = embedded_test_server();
87 ASSERT_TRUE(test_server->InitializeAndWaitUntilReady()); 87 ASSERT_TRUE(test_server->Start());
88 test_server->RegisterRequestHandler( 88 test_server->RegisterRequestHandler(
89 base::Bind(&HandlePostAndRedirectURLs, kRedirectPostPath)); 89 base::Bind(&HandlePostAndRedirectURLs, kRedirectPostPath));
90 90
91 NavigateToURL(shell(), 91 NavigateToURL(shell(),
92 test_server->GetURL("/loader/async_resource_handler.html")); 92 test_server->GetURL("/loader/async_resource_handler.html"));
93 93
94 std::string js_result; 94 std::string js_result;
95 EXPECT_TRUE(ExecuteScriptAndExtractString( 95 EXPECT_TRUE(ExecuteScriptAndExtractString(
96 shell()->web_contents(), 96 shell()->web_contents(),
97 base::StringPrintf("WaitForAsyncXHR('%s', %" PRIuS ")", 97 base::StringPrintf("WaitForAsyncXHR('%s', %" PRIuS ")",
98 kRedirectPostPath, 98 kRedirectPostPath,
99 kPayloadSize), 99 kPayloadSize),
100 &js_result)); 100 &js_result));
101 EXPECT_EQ(js_result, "success"); 101 EXPECT_EQ(js_result, "success");
102 } 102 }
103 103
104 } // namespace content 104 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698