OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/public/browser/service_worker_context.h" | 5 #include "content/public/browser/service_worker_context.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 | 618 |
619 TEST_P(ServiceWorkerContextRecoveryTest, DeleteAndStartOver) { | 619 TEST_P(ServiceWorkerContextRecoveryTest, DeleteAndStartOver) { |
620 GURL pattern("http://www.example.com/"); | 620 GURL pattern("http://www.example.com/"); |
621 GURL script_url("http://www.example.com/service_worker.js"); | 621 GURL script_url("http://www.example.com/service_worker.js"); |
622 | 622 |
623 bool is_storage_on_disk = GetParam(); | 623 bool is_storage_on_disk = GetParam(); |
624 if (is_storage_on_disk) { | 624 if (is_storage_on_disk) { |
625 // Reinitialize the helper to test on-disk storage. | 625 // Reinitialize the helper to test on-disk storage. |
626 base::ScopedTempDir user_data_directory; | 626 base::ScopedTempDir user_data_directory; |
627 ASSERT_TRUE(user_data_directory.CreateUniqueTempDir()); | 627 ASSERT_TRUE(user_data_directory.CreateUniqueTempDir()); |
628 helper_.reset(new EmbeddedWorkerTestHelper(user_data_directory.path())); | 628 helper_.reset(new EmbeddedWorkerTestHelper(user_data_directory.GetPath())); |
629 helper_->context_wrapper()->AddObserver(this); | 629 helper_->context_wrapper()->AddObserver(this); |
630 } | 630 } |
631 | 631 |
632 int64_t registration_id = kInvalidServiceWorkerRegistrationId; | 632 int64_t registration_id = kInvalidServiceWorkerRegistrationId; |
633 bool called = false; | 633 bool called = false; |
634 context()->RegisterServiceWorker( | 634 context()->RegisterServiceWorker( |
635 pattern, | 635 pattern, |
636 script_url, | 636 script_url, |
637 NULL, | 637 NULL, |
638 MakeRegisteredCallback(&called, ®istration_id)); | 638 MakeRegisteredCallback(&called, ®istration_id)); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 EXPECT_EQ(pattern, notifications_[0].pattern); | 704 EXPECT_EQ(pattern, notifications_[0].pattern); |
705 EXPECT_EQ(registration_id, notifications_[0].registration_id); | 705 EXPECT_EQ(registration_id, notifications_[0].registration_id); |
706 EXPECT_EQ(STORAGE_RECOVERED, notifications_[1].type); | 706 EXPECT_EQ(STORAGE_RECOVERED, notifications_[1].type); |
707 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type); | 707 EXPECT_EQ(REGISTRATION_STORED, notifications_[2].type); |
708 EXPECT_EQ(pattern, notifications_[2].pattern); | 708 EXPECT_EQ(pattern, notifications_[2].pattern); |
709 EXPECT_EQ(registration_id, notifications_[2].registration_id); | 709 EXPECT_EQ(registration_id, notifications_[2].registration_id); |
710 } | 710 } |
711 | 711 |
712 | 712 |
713 } // namespace content | 713 } // namespace content |
OLD | NEW |