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

Side by Side Diff: content/browser/payments/payment_app_content_unittest_base.h

Issue 2610163002: PaymentApp: Implement InvokePaymentApp() in browser side. (Closed)
Patch Set: nhiroki's comments Created 3 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
« no previous file with comments | « no previous file | content/browser/payments/payment_app_content_unittest_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 #ifndef CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTENT_UNITTEST_BASE_H_ 5 #ifndef CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTENT_UNITTEST_BASE_H_
6 #define CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTENT_UNITTEST_BASE_H_ 6 #define CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTENT_UNITTEST_BASE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "components/payments/payment_app.mojom.h" 14 #include "components/payments/payment_app.mojom.h"
15 #include "content/browser/payments/payment_app_manager.h" 15 #include "content/browser/payments/payment_app_manager.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 #include "url/gurl.h" 17 #include "url/gurl.h"
18 18
19 namespace content { 19 namespace content {
20 20
21 class BrowserContext; 21 class BrowserContext;
22 class EmbeddedWorkerTestHelper;
23 class PaymentAppContextImpl; 22 class PaymentAppContextImpl;
24 class StoragePartitionImpl; 23 class StoragePartitionImpl;
25 class TestBrowserThreadBundle; 24 class TestBrowserThreadBundle;
26 25
27 class PaymentAppContentUnitTestBase : public testing::Test { 26 class PaymentAppContentUnitTestBase : public testing::Test {
28 protected: 27 protected:
29 PaymentAppContentUnitTestBase(); 28 PaymentAppContentUnitTestBase();
30 ~PaymentAppContentUnitTestBase() override; 29 ~PaymentAppContentUnitTestBase() override;
31 30
32 BrowserContext* browser_context(); 31 BrowserContext* browser_context();
33 PaymentAppManager* CreatePaymentAppManager(const GURL& scope_url, 32 PaymentAppManager* CreatePaymentAppManager(const GURL& scope_url,
34 const GURL& sw_script_url); 33 const GURL& sw_script_url);
35 void SetManifest(PaymentAppManager* manager, 34 void SetManifest(PaymentAppManager* manager,
36 payments::mojom::PaymentAppManifestPtr manifest, 35 payments::mojom::PaymentAppManifestPtr manifest,
37 const PaymentAppManager::SetManifestCallback& callback); 36 const PaymentAppManager::SetManifestCallback& callback);
38 void GetManifest(PaymentAppManager* manager, 37 void GetManifest(PaymentAppManager* manager,
39 const PaymentAppManager::GetManifestCallback& callback); 38 const PaymentAppManager::GetManifestCallback& callback);
40 payments::mojom::PaymentAppManifestPtr CreatePaymentAppManifestForTest( 39 payments::mojom::PaymentAppManifestPtr CreatePaymentAppManifestForTest(
41 const std::string& name); 40 const std::string& name);
42 void UnregisterServiceWorker(const GURL& scope_url); 41 void UnregisterServiceWorker(const GURL& scope_url);
43 42
43 void ResetPaymentAppInvoked() const;
44 bool payment_app_invoked() const;
45 int64_t last_sw_registration_id() const;
46 const GURL& last_sw_scope_url() const;
47
44 private: 48 private:
49 class PaymentAppForWorkerTestHelper;
50
45 StoragePartitionImpl* storage_partition(); 51 StoragePartitionImpl* storage_partition();
46 PaymentAppContextImpl* payment_app_context(); 52 PaymentAppContextImpl* payment_app_context();
47 53
48 std::unique_ptr<TestBrowserThreadBundle> thread_bundle_; 54 std::unique_ptr<TestBrowserThreadBundle> thread_bundle_;
49 std::unique_ptr<EmbeddedWorkerTestHelper> embedded_worker_helper_; 55 std::unique_ptr<PaymentAppForWorkerTestHelper> worker_helper_;
50 std::vector<payments::mojom::PaymentAppManagerPtr> payment_app_managers_; 56 std::vector<payments::mojom::PaymentAppManagerPtr> payment_app_managers_;
51 57
52 DISALLOW_COPY_AND_ASSIGN(PaymentAppContentUnitTestBase); 58 DISALLOW_COPY_AND_ASSIGN(PaymentAppContentUnitTestBase);
53 }; 59 };
54 60
55 } // namespace content 61 } // namespace content
56 62
57 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTENT_UNITTEST_BASE_H_ 63 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTENT_UNITTEST_BASE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/payments/payment_app_content_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698