OLD | NEW |
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 "content/browser/payments/payment_app_manager.h" | 5 #include "content/browser/payments/payment_app_manager.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
55 class PaymentAppManagerTest : public testing::Test { | 55 class PaymentAppManagerTest : public testing::Test { |
56 public: | 56 public: |
57 PaymentAppManagerTest() | 57 PaymentAppManagerTest() |
58 : thread_bundle_( | 58 : thread_bundle_( |
59 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)), | 59 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)), |
60 embedded_worker_helper_(new EmbeddedWorkerTestHelper(base::FilePath())), | 60 embedded_worker_helper_(new EmbeddedWorkerTestHelper(base::FilePath())), |
61 storage_partition_impl_(new StoragePartitionImpl( | 61 storage_partition_impl_(new StoragePartitionImpl( |
62 embedded_worker_helper_->browser_context(), base::FilePath(), | 62 embedded_worker_helper_->browser_context(), |
63 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, | 63 base::FilePath(), nullptr)) { |
64 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) { | |
65 | 64 |
66 embedded_worker_helper_->context_wrapper()->set_storage_partition( | 65 embedded_worker_helper_->context_wrapper()->set_storage_partition( |
67 storage_partition_impl_.get()); | 66 storage_partition_impl_.get()); |
68 | 67 |
69 payment_app_context_ = | 68 payment_app_context_ = |
70 new PaymentAppContext(embedded_worker_helper_->context_wrapper()); | 69 new PaymentAppContext(embedded_worker_helper_->context_wrapper()); |
71 | 70 |
72 bool called = false; | 71 bool called = false; |
73 embedded_worker_helper_->context()->RegisterServiceWorker( | 72 embedded_worker_helper_->context()->RegisterServiceWorker( |
74 GURL(kServiceWorkerPattern), GURL(kServiceWorkerScript), NULL, | 73 GURL(kServiceWorkerPattern), GURL(kServiceWorkerScript), NULL, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 payments::mojom::PaymentAppManifestPtr read_manifest; | 157 payments::mojom::PaymentAppManifestPtr read_manifest; |
159 payments::mojom::PaymentAppManifestError read_error; | 158 payments::mojom::PaymentAppManifestError read_error; |
160 GetManifest(kServiceWorkerPattern, | 159 GetManifest(kServiceWorkerPattern, |
161 base::Bind(&GetManifestCallback, &read_manifest, &read_error)); | 160 base::Bind(&GetManifestCallback, &read_manifest, &read_error)); |
162 | 161 |
163 EXPECT_EQ(read_error, payments::mojom::PaymentAppManifestError:: | 162 EXPECT_EQ(read_error, payments::mojom::PaymentAppManifestError:: |
164 MANIFEST_STORAGE_OPERATION_FAILED); | 163 MANIFEST_STORAGE_OPERATION_FAILED); |
165 } | 164 } |
166 | 165 |
167 } // namespace content | 166 } // namespace content |
OLD | NEW |