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

Side by Side Diff: chrome/browser/captive_portal/captive_portal_browsertest.cc

Issue 889463003: GURL::Replacements methods accept a StringPiece instead of std::string&. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase (fixed some merge conflicts). Created 5 years, 10 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 unified diff | Download patch
OLDNEW
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 <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after
2680 SlowLoadBehindCaptivePortal(browser(), true, GURL(kMockHttpsUrl), 2, 2); 2680 SlowLoadBehindCaptivePortal(browser(), true, GURL(kMockHttpsUrl), 2, 2);
2681 Login(browser(), 1, 0); 2681 Login(browser(), 1, 0);
2682 FailLoadsAfterLogin(browser(), 1); 2682 FailLoadsAfterLogin(browser(), 1);
2683 } 2683 }
2684 2684
2685 // HSTS redirects an HTTP request to HTTPS, and the request then times out. 2685 // HSTS redirects an HTTP request to HTTPS, and the request then times out.
2686 // A captive portal is then detected, and a login tab opened, before logging 2686 // A captive portal is then detected, and a login tab opened, before logging
2687 // in. 2687 // in.
2688 IN_PROC_BROWSER_TEST_F(CaptivePortalBrowserTest, HstsLogin) { 2688 IN_PROC_BROWSER_TEST_F(CaptivePortalBrowserTest, HstsLogin) {
2689 GURL::Replacements replacements; 2689 GURL::Replacements replacements;
2690 std::string scheme = "http"; 2690 replacements.SetSchemeStr("http");
2691 replacements.SetSchemeStr(scheme);
2692 GURL http_timeout_url = GURL(kMockHttpsUrl).ReplaceComponents(replacements); 2691 GURL http_timeout_url = GURL(kMockHttpsUrl).ReplaceComponents(replacements);
2693 2692
2694 URLRequestFailedJob::GetMockHttpUrl(net::ERR_CONNECTION_TIMED_OUT); 2693 URLRequestFailedJob::GetMockHttpUrl(net::ERR_CONNECTION_TIMED_OUT);
2695 content::BrowserThread::PostTask( 2694 content::BrowserThread::PostTask(
2696 content::BrowserThread::IO, FROM_HERE, 2695 content::BrowserThread::IO, FROM_HERE,
2697 base::Bind(&AddHstsHost, 2696 base::Bind(&AddHstsHost,
2698 make_scoped_refptr(browser()->profile()->GetRequestContext()), 2697 make_scoped_refptr(browser()->profile()->GetRequestContext()),
2699 http_timeout_url.host())); 2698 http_timeout_url.host()));
2700 2699
2701 SlowLoadBehindCaptivePortal(browser(), true, http_timeout_url, 1, 1); 2700 SlowLoadBehindCaptivePortal(browser(), true, http_timeout_url, 1, 1);
(...skipping 29 matching lines...) Expand all
2731 2730
2732 EXPECT_EQ(CaptivePortalTabReloader::STATE_NEEDS_RELOAD, 2731 EXPECT_EQ(CaptivePortalTabReloader::STATE_NEEDS_RELOAD,
2733 GetStateOfTabReloaderAt(browser(), broken_tab_index)); 2732 GetStateOfTabReloaderAt(browser(), broken_tab_index));
2734 2733
2735 WaitForInterstitialAttach(broken_tab_contents); 2734 WaitForInterstitialAttach(broken_tab_contents);
2736 portal_observer.WaitForResults(1); 2735 portal_observer.WaitForResults(1);
2737 2736
2738 EXPECT_EQ(SSLBlockingPage::kTypeForTesting, 2737 EXPECT_EQ(SSLBlockingPage::kTypeForTesting,
2739 GetInterstitialType(broken_tab_contents)); 2738 GetInterstitialType(broken_tab_contents));
2740 } 2739 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc ('k') | chrome/browser/chromeos/app_mode/fake_cws.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698