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

Unified Diff: chrome/browser/ui/views/payments/payment_request_browsertest_base.h

Issue 2859613002: Disable web payments API on blob: and data: schemes. (Closed)
Patch Set: Fix up Android test Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/payments/payment_request_browsertest_base.h
diff --git a/chrome/browser/ui/views/payments/payment_request_browsertest_base.h b/chrome/browser/ui/views/payments/payment_request_browsertest_base.h
index 38dc2314a71ac51aabd3435207946981f4fedbcc..8365bff4cf563b77ea4a56d5ddff4857a408efed 100644
--- a/chrome/browser/ui/views/payments/payment_request_browsertest_base.h
+++ b/chrome/browser/ui/views/payments/payment_request_browsertest_base.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_BROWSERTEST_BASE_H_
#define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_BROWSERTEST_BASE_H_
+#include <iosfwd>
#include <list>
#include <memory>
#include <string>
@@ -23,7 +24,6 @@
#include "components/payments/mojom/payment_request.mojom.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/gmock/include/gmock/gmock.h"
-#include "ui/views/widget/widget_observer.h"
namespace autofill {
class AutofillProfile;
@@ -38,10 +38,6 @@ namespace service_manager {
struct BindSourceInfo;
}
-namespace views {
-class Widget;
-}
-
namespace payments {
enum class DialogViewID;
@@ -64,8 +60,30 @@ class PersonalDataLoadedObserverMock
class PaymentRequestBrowserTestBase
: public InProcessBrowserTest,
public PaymentRequest::ObserverForTest,
- public PaymentRequestDialogView::ObserverForTest,
- public views::WidgetObserver {
+ public PaymentRequestDialogView::ObserverForTest {
+ public:
+ // Various events that can be waited on by the DialogEventObserver.
+ enum DialogEvent : int {
+ DIALOG_OPENED,
+ DIALOG_CLOSED,
+ ORDER_SUMMARY_OPENED,
+ PAYMENT_METHOD_OPENED,
+ SHIPPING_ADDRESS_SECTION_OPENED,
+ SHIPPING_OPTION_SECTION_OPENED,
+ CREDIT_CARD_EDITOR_OPENED,
+ SHIPPING_ADDRESS_EDITOR_OPENED,
+ CONTACT_INFO_EDITOR_OPENED,
+ BACK_NAVIGATION,
+ BACK_TO_PAYMENT_SHEET_NAVIGATION,
+ CONTACT_INFO_OPENED,
+ EDITOR_VIEW_UPDATED,
+ CAN_MAKE_PAYMENT_CALLED,
+ ERROR_MESSAGE_SHOWN,
+ SPEC_DONE_UPDATING,
+ CVC_PROMPT_SHOWN,
+ NOT_SUPPORTED_ERROR,
+ };
+
protected:
// Test will open a browser window to |test_file_path| (relative to
// chrome/test/data/payments).
@@ -82,6 +100,7 @@ class PaymentRequestBrowserTestBase
// PaymentRequest::ObserverForTest:
void OnCanMakePaymentCalled() override;
void OnNotSupportedError() override;
+ void OnConnectionTerminated() override;
// PaymentRequestDialogView::ObserverForTest:
void OnDialogOpened() override;
@@ -100,10 +119,6 @@ class PaymentRequestBrowserTestBase
void OnSpecDoneUpdating() override;
void OnCvcPromptShown() override;
- // views::WidgetObserver
- // Effective way to be warned of all dialog closures.
- void OnWidgetDestroyed(views::Widget* widget) override;
-
// Will call JavaScript to invoke the PaymentRequest dialog and verify that
// it's open.
void InvokePaymentRequestUI();
@@ -199,28 +214,6 @@ class PaymentRequestBrowserTestBase
delegate_->SetRegionDataLoader(region_data_loader);
}
- // Various events that can be waited on by the DialogEventObserver.
- enum DialogEvent : int {
- DIALOG_OPENED,
- DIALOG_CLOSED,
- ORDER_SUMMARY_OPENED,
- PAYMENT_METHOD_OPENED,
- SHIPPING_ADDRESS_SECTION_OPENED,
- SHIPPING_OPTION_SECTION_OPENED,
- CREDIT_CARD_EDITOR_OPENED,
- SHIPPING_ADDRESS_EDITOR_OPENED,
- CONTACT_INFO_EDITOR_OPENED,
- BACK_NAVIGATION,
- BACK_TO_PAYMENT_SHEET_NAVIGATION,
- CONTACT_INFO_OPENED,
- EDITOR_VIEW_UPDATED,
- CAN_MAKE_PAYMENT_CALLED,
- ERROR_MESSAGE_SHOWN,
- SPEC_DONE_UPDATING,
- CVC_PROMPT_SHOWN,
- NOT_SUPPORTED_ERROR,
- };
-
// DialogEventObserver is used to wait on specific events that may have
// occured before the call to Wait(), or after, in which case a RunLoop is
// used.
@@ -273,4 +266,8 @@ class PaymentRequestBrowserTestBase
} // namespace payments
+std::ostream& operator<<(
+ std::ostream& out,
+ payments::PaymentRequestBrowserTestBase::DialogEvent event);
+
#endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_BROWSERTEST_BASE_H_

Powered by Google App Engine
This is Rietveld 408576698