| Index: content/browser/service_worker/service_worker_storage_unittest.cc
|
| diff --git a/content/browser/service_worker/service_worker_storage_unittest.cc b/content/browser/service_worker/service_worker_storage_unittest.cc
|
| index 97312a56b215b6f58f0c3c2ff678d31b1e82fdbc..fb743e953f94995c5c7b288ad777f5ccd2cf6313 100644
|
| --- a/content/browser/service_worker/service_worker_storage_unittest.cc
|
| +++ b/content/browser/service_worker/service_worker_storage_unittest.cc
|
| @@ -1096,6 +1096,35 @@ TEST_P(ServiceWorkerStorageTestP, StoreUserData) {
|
| GetUserDataForAllRegistrations(std::string(), &data_list_out));
|
| }
|
|
|
| +// The *_BeforeInitialize tests exercise the API before LazyInitialize() is
|
| +// called.
|
| +TEST_P(ServiceWorkerStorageTestP, StoreUserData_BeforeInitialize) {
|
| + const int kRegistrationId = 0;
|
| + EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND,
|
| + StoreUserData(kRegistrationId, GURL("https://example.com"),
|
| + {{"key", "data"}}));
|
| +}
|
| +
|
| +TEST_P(ServiceWorkerStorageTestP, GetUserData_BeforeInitialize) {
|
| + const int kRegistrationId = 0;
|
| + std::vector<std::string> data_out;
|
| + EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND,
|
| + GetUserData(kRegistrationId, {"key"}, &data_out));
|
| +}
|
| +
|
| +TEST_P(ServiceWorkerStorageTestP, ClearUserData_BeforeInitialize) {
|
| + const int kRegistrationId = 0;
|
| + EXPECT_EQ(SERVICE_WORKER_OK, ClearUserData(kRegistrationId, {"key"}));
|
| +}
|
| +
|
| +TEST_P(ServiceWorkerStorageTestP,
|
| + GetUserDataForAllRegistrations_BeforeInitialize) {
|
| + std::vector<std::pair<int64_t, std::string>> data_list_out;
|
| + EXPECT_EQ(SERVICE_WORKER_OK,
|
| + GetUserDataForAllRegistrations("key", &data_list_out));
|
| + EXPECT_TRUE(data_list_out.empty());
|
| +}
|
| +
|
| class ServiceWorkerResourceStorageTest : public ServiceWorkerStorageTestP {
|
| public:
|
| void SetUp() override {
|
|
|