chromium/chrome/browser/ui/views/payments/payment_sheet_view_controller_browsertest.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h"
#include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h"
#include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "net/dns/mock_host_resolver.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/test/mock_input_event_activation_protector.h"

namespace payments {

class PaymentSheetViewControllerTest : public PaymentRequestBrowserTestBase {};

// The [Continue] button should be protected against accidental double-inputs.
IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerTest,
                       ContinueButtonIgnoresAccidentalInputs) {}

// The 'Continue' or 'Cancel' buttons should not be auto-focused; see
// https://crbug.com/1403539
IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerTest,
                       ContinueIsNotAutoFocused) {}

// The Enter key should not be accelerated for the main payment sheet; see
// https://crbug.com/1403539
IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerTest, EnterDoesNotContinue) {}

// Test that the content view of the payment sheet view is contained by a
// ScrollView.
IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerTest, ContentViewScrollable) {}

PaymentSheetViewControllerNoShippingTest;

// If shipping and contact info are not requested, their rows should not be
// present.
IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerNoShippingTest,
                       NoShippingNoContactRows) {}

}  // namespace payments