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

Side by Side Diff: chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc

Issue 2968123002: Introduce ServiceWorkerRegistrationOptions struct for service worker options (Closed)
Patch Set: address more comments Created 3 years, 5 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
« no previous file with comments | « no previous file | content/browser/background_fetch/background_fetch_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/browser/android/webapps/add_to_homescreen_data_fetcher.h" 5 #include "chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 MockWebContents* mock_web_contents = 256 MockWebContents* mock_web_contents =
257 static_cast<MockWebContents*>(web_contents()); 257 static_cast<MockWebContents*>(web_contents());
258 mock_web_contents->SetShouldManifestTimeOut(should_time_out); 258 mock_web_contents->SetShouldManifestTimeOut(should_time_out);
259 } 259 }
260 260
261 // Registers service worker at |url|. Blocks till the service worker is 261 // Registers service worker at |url|. Blocks till the service worker is
262 // registered. 262 // registered.
263 void RegisterServiceWorker(const GURL& url) { 263 void RegisterServiceWorker(const GURL& url) {
264 base::RunLoop run_loop; 264 base::RunLoop run_loop;
265 embedded_worker_test_helper_->context()->RegisterServiceWorker( 265 embedded_worker_test_helper_->context()->RegisterServiceWorker(
266 url, GURL(url.spec() + "/service_worker.js"), nullptr, 266 GURL(url.spec() + "/service_worker.js"),
267 content::ServiceWorkerRegistrationOptions(url), nullptr,
267 base::Bind(&AddToHomescreenDataFetcherTest::OnServiceWorkerRegistered, 268 base::Bind(&AddToHomescreenDataFetcherTest::OnServiceWorkerRegistered,
268 base::Unretained(this), run_loop.QuitClosure())); 269 base::Unretained(this), run_loop.QuitClosure()));
269 } 270 }
270 271
271 private: 272 private:
272 // Callback for RegisterServiceWorker() for when service worker registration 273 // Callback for RegisterServiceWorker() for when service worker registration
273 // has completed. 274 // has completed.
274 void OnServiceWorkerRegistered(const base::Closure& callback, 275 void OnServiceWorkerRegistered(const base::Closure& callback,
275 content::ServiceWorkerStatusCode status, 276 content::ServiceWorkerStatusCode status,
276 const std::string& status_message, 277 const std::string& status_message,
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 EXPECT_TRUE(base::EqualsASCII(waiter.title(), kDefaultManifestShortName)); 463 EXPECT_TRUE(base::EqualsASCII(waiter.title(), kDefaultManifestShortName));
463 EXPECT_TRUE(base::EqualsASCII(fetcher->shortcut_info().user_title, 464 EXPECT_TRUE(base::EqualsASCII(fetcher->shortcut_info().user_title,
464 kDefaultManifestShortName)); 465 kDefaultManifestShortName));
465 466
466 fetcher->set_weak_observer(nullptr); 467 fetcher->set_weak_observer(nullptr);
467 } 468 }
468 469
469 INSTANTIATE_TEST_CASE_P(CheckWebApkCompatibility, 470 INSTANTIATE_TEST_CASE_P(CheckWebApkCompatibility,
470 AddToHomescreenDataFetcherTestCommon, 471 AddToHomescreenDataFetcherTestCommon,
471 ::testing::Values(false, true)); 472 ::testing::Values(false, true));
OLDNEW
« no previous file with comments | « no previous file | content/browser/background_fetch/background_fetch_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698