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

Side by Side Diff: content/browser/service_worker/service_worker_browsertest.cc

Issue 862053002: Fix referrer policy handling in service workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/browser/fileapi/chrome_blob_storage_context.h" 10 #include "content/browser/fileapi/chrome_blob_storage_context.h"
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 } 540 }
541 541
542 void FetchOnIOThread(const base::Closure& done, 542 void FetchOnIOThread(const base::Closure& done,
543 bool* prepare_result, 543 bool* prepare_result,
544 FetchResult* result) { 544 FetchResult* result) {
545 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 545 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
546 ServiceWorkerFetchRequest request( 546 ServiceWorkerFetchRequest request(
547 embedded_test_server()->GetURL("/service_worker/empty.html"), 547 embedded_test_server()->GetURL("/service_worker/empty.html"),
548 "GET", 548 "GET",
549 ServiceWorkerHeaderMap(), 549 ServiceWorkerHeaderMap(),
550 GURL(""), 550 Referrer(),
551 false); 551 false);
552 version_->SetStatus(ServiceWorkerVersion::ACTIVATED); 552 version_->SetStatus(ServiceWorkerVersion::ACTIVATED);
553 version_->DispatchFetchEvent( 553 version_->DispatchFetchEvent(
554 request, 554 request,
555 CreatePrepareReceiver(prepare_result), 555 CreatePrepareReceiver(prepare_result),
556 CreateResponseReceiver( 556 CreateResponseReceiver(
557 BrowserThread::UI, done, blob_context_.get(), result)); 557 BrowserThread::UI, done, blob_context_.get(), result));
558 } 558 }
559 559
560 void StopOnIOThread(const base::Closure& done, 560 void StopOnIOThread(const base::Closure& done,
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 const base::string16 kOKTitle2(base::ASCIIToUTF16("OK_2")); 969 const base::string16 kOKTitle2(base::ASCIIToUTF16("OK_2"));
970 const base::string16 kFailTitle2(base::ASCIIToUTF16("FAIL_2")); 970 const base::string16 kFailTitle2(base::ASCIIToUTF16("FAIL_2"));
971 content::TitleWatcher title_watcher2(shell()->web_contents(), kOKTitle2); 971 content::TitleWatcher title_watcher2(shell()->web_contents(), kOKTitle2);
972 title_watcher2.AlsoWaitForTitle(kFailTitle2); 972 title_watcher2.AlsoWaitForTitle(kFailTitle2);
973 973
974 NavigateToURL(shell(), embedded_test_server()->GetURL(kConfirmPageUrl)); 974 NavigateToURL(shell(), embedded_test_server()->GetURL(kConfirmPageUrl));
975 EXPECT_EQ(kOKTitle2, title_watcher2.WaitAndGetTitle()); 975 EXPECT_EQ(kOKTitle2, title_watcher2.WaitAndGetTitle());
976 } 976 }
977 977
978 } // namespace content 978 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698