Commit 3424e405 authored by Moe Ahmadi's avatar Moe Ahmadi Committed by Commit Bot

[IOS][PR] Removes web-payments & web-payments-native-apps in chrome://flags

Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I7303af44d7ada834b3d22e1cfdf5245976d7defc
Reviewed-on: https://chromium-review.googlesource.com/1249910
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: default avatarEric Noyau <noyau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595643}
parent 5fae86f4
......@@ -11,9 +11,6 @@ const base::Feature kReturnGooglePayInBasicCard{
"ReturnGooglePayInBasicCard", base::FEATURE_DISABLED_BY_DEFAULT};
#if defined(OS_IOS)
const base::Feature kWebPayments{"WebPayments",
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kWebPaymentsNativeApps{"WebPaymentsNativeApps",
base::FEATURE_DISABLED_BY_DEFAULT};
#endif
......
......@@ -15,9 +15,6 @@ namespace features {
extern const base::Feature kReturnGooglePayInBasicCard;
#if defined(OS_IOS)
// Used to control the state of the Payment Request API feature.
extern const base::Feature kWebPayments;
// Used to control the support for iOS third party apps as payment methods.
extern const base::Feature kWebPaymentsNativeApps;
#endif
......
......@@ -161,12 +161,6 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
security_state::features::kMarkHttpAsFeature,
kMarkHttpAsFeatureVariations,
"MarkHttpAs")},
{"web-payments", flag_descriptions::kWebPaymentsName,
flag_descriptions::kWebPaymentsDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(payments::features::kWebPayments)},
{"web-payments-native-apps", flag_descriptions::kWebPaymentsNativeAppsName,
flag_descriptions::kWebPaymentsNativeAppsDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(payments::features::kWebPaymentsNativeApps)},
{"ios-captive-portal-metrics", flag_descriptions::kCaptivePortalMetricsName,
flag_descriptions::kCaptivePortalMetricsDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kCaptivePortalMetrics)},
......
......@@ -280,15 +280,6 @@ const char kWebPageTextAccessibilityDescription[] =
"When enabled, text in web pages will respect the user's Dynamic Type "
"setting.";
const char kWebPaymentsName[] = "Web Payments";
const char kWebPaymentsDescription[] =
"Enable Payment Request API integration, a JavaScript API for merchants.";
const char kWebPaymentsNativeAppsName[] = "Web Payments Native Apps";
const char kWebPaymentsNativeAppsDescription[] =
"Enable third party iOS native apps as payments methods within Payment "
"Request.";
const char kWKHTTPSystemCookieStoreName[] = "Use WKHTTPSystemCookieStore.";
const char kWKHTTPSystemCookieStoreDescription[] =
"Use WKHTTPCookieStore backed store for main context URL requests.";
......
......@@ -232,15 +232,6 @@ extern const char kWebFrameMessagingDescription[];
extern const char kWebPageTextAccessibilityName[];
extern const char kWebPageTextAccessibilityDescription[];
// Title and description for the flag to enable Web Payments.
extern const char kWebPaymentsName[];
extern const char kWebPaymentsDescription[];
// Title and description for the flag to enable third party payment app
// integration with Web Payments.
extern const char kWebPaymentsNativeAppsName[];
extern const char kWebPaymentsNativeAppsDescription[];
// Title and description for the flag to enable WKHTTPSystemCookieStore usage
// for main context URL requests.
extern const char kWKHTTPSystemCookieStoreName[];
......
......@@ -39,7 +39,6 @@
#include "components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h"
#include "components/infobars/core/infobar_manager.h"
#import "components/language/ios/browser/ios_language_detection_tab_helper.h"
#include "components/payments/core/features.h"
#include "components/prefs/pref_service.h"
#include "components/reading_list/core/reading_list_model.h"
#include "components/search_engines/search_engines_pref_names.h"
......@@ -2375,14 +2374,12 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
_externalSearchCoordinator = [[ExternalSearchCoordinator alloc] init];
_externalSearchCoordinator.dispatcher = _dispatcher;
if (base::FeatureList::IsEnabled(payments::features::kWebPayments)) {
_paymentRequestManager = [[PaymentRequestManager alloc]
initWithBaseViewController:self
browserState:_browserState
dispatcher:self.dispatcher];
[_paymentRequestManager setToolbarModel:_toolbarModel.get()];
[_paymentRequestManager setActiveWebState:[_model currentTab].webState];
}
_paymentRequestManager = [[PaymentRequestManager alloc]
initWithBaseViewController:self
browserState:_browserState
dispatcher:self.dispatcher];
[_paymentRequestManager setToolbarModel:_toolbarModel.get()];
[_paymentRequestManager setActiveWebState:[_model currentTab].webState];
}
// Set the frame for the various views. View must be loaded.
......
......@@ -11,9 +11,7 @@
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/strings/sys_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
#include "components/payments/core/features.h"
#include "components/prefs/testing_pref_service.h"
#include "components/search_engines/template_url_service.h"
#include "components/sessions/core/tab_restore_service.h"
......@@ -350,25 +348,4 @@ TEST_F(BrowserViewControllerTest, TestClearPresentedState) {
dismissOmnibox:YES];
}
// Tests for the browser view controller when Payment Request is enabled.
class PaymentRequestBrowserViewControllerTest
: public BrowserViewControllerTest {
public:
PaymentRequestBrowserViewControllerTest() {}
protected:
void SetUp() override {
feature_list_.InitAndEnableFeature(payments::features::kWebPayments);
BrowserViewControllerTest::SetUp();
}
base::test::ScopedFeatureList feature_list_;
};
// Verifies that the controller starts up and shuts down cleanly with Payment
// Request enabled.
TEST_F(PaymentRequestBrowserViewControllerTest, TestStartupAndShutdown) {
// The body of this test is deliberately left empty.
}
} // namespace
......@@ -7,7 +7,6 @@
#include <algorithm>
#include <memory>
#include "base/feature_list.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"
......@@ -15,7 +14,6 @@
#include "components/autofill/core/browser/autofill_profile.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/payments/core/features.h"
#include "components/strings/grit/components_strings.h"
#include "ios/chrome/browser/autofill/personal_data_manager_factory.h"
#include "ios/chrome/browser/payments/ios_payment_request_cache_factory.h"
......@@ -52,16 +50,6 @@ const NSTimeInterval kPDMMaxDelaySeconds = 10.0;
#pragma mark - XCTestCase
+ (void)setUp {
[super setUp];
if (!base::FeatureList::IsEnabled(payments::features::kWebPayments)) {
// payments::features::kWebPayments feature is not enabled,
// You have to pass --enable-features=WebPayments command line argument in
// order to run this test.
DCHECK(false);
}
}
- (void)setUp {
[super setUp];
_personalDataManager =
......
......@@ -11,7 +11,6 @@
#include "base/mac/bundle_locations.h"
#include "base/strings/sys_string_conversions.h"
#include "components/dom_distiller/core/url_constants.h"
#include "components/payments/core/features.h"
#include "components/strings/grit/components_strings.h"
#include "components/version_info/version_info.h"
#include "ios/chrome/browser/application_context.h"
......@@ -187,9 +186,7 @@ NSString* ChromeWebClient::GetDocumentStartScriptForMainFrame(
[scripts addObject:GetPageScript(@"credential_manager")];
}
if (base::FeatureList::IsEnabled(payments::features::kWebPayments)) {
[scripts addObject:GetPageScript(@"payment_request")];
}
[scripts addObject:GetPageScript(@"payment_request")];
return [scripts componentsJoinedByString:@";"];
}
......
......@@ -13,7 +13,6 @@
#include "base/strings/sys_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/scoped_task_environment.h"
#include "components/payments/core/features.h"
#include "ios/chrome/browser/browser_state/test_chrome_browser_state.h"
#include "ios/chrome/browser/passwords/credential_manager_features.h"
#import "ios/chrome/browser/web/error_page_util.h"
......@@ -163,16 +162,13 @@ TEST_F(ChromeWebClientTest, WKWebViewEarlyPageScriptCredentialManager) {
web_view, @"typeof navigator.credentials"));
}
// Tests that ChromeWebClient provides payment request script for WKWebView if
// the feature is enabled.
TEST_F(ChromeWebClientTest, WKWebViewEarlyPageScriptPaymentRequestEnabled) {
// Tests that ChromeWebClient provides payment request script for WKWebView.
TEST_F(ChromeWebClientTest, WKWebViewEarlyPageScriptPaymentRequest) {
// Chrome scripts rely on __gCrWeb object presence.
WKWebView* web_view = web::BuildWKWebView(CGRectZero, browser_state());
web::test::ExecuteJavaScript(web_view, @"__gCrWeb = {};");
web::ScopedTestingWebClient web_client(std::make_unique<ChromeWebClient>());
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(payments::features::kWebPayments);
NSString* script =
web_client.Get()->GetDocumentStartScriptForMainFrame(browser_state());
web::test::ExecuteJavaScript(web_view, script);
......@@ -180,23 +176,6 @@ TEST_F(ChromeWebClientTest, WKWebViewEarlyPageScriptPaymentRequestEnabled) {
web_view, @"typeof window.PaymentRequest"));
}
// Tests that ChromeWebClient does not provide payment request script for
// WKWebView if the feature is disabled.
TEST_F(ChromeWebClientTest, WKWebViewEarlyPageScriptPaymentRequestDisabled) {
// Chrome scripts rely on __gCrWeb object presence.
WKWebView* web_view = web::BuildWKWebView(CGRectZero, browser_state());
web::test::ExecuteJavaScript(web_view, @"__gCrWeb = {};");
web::ScopedTestingWebClient web_client(std::make_unique<ChromeWebClient>());
base::test::ScopedFeatureList feature_list;
feature_list.InitAndDisableFeature(payments::features::kWebPayments);
NSString* script =
web_client.Get()->GetDocumentStartScriptForMainFrame(browser_state());
web::test::ExecuteJavaScript(web_view, script);
EXPECT_NSEQ(@"undefined", web::test::ExecuteJavaScript(
web_view, @"typeof window.PaymentRequest"));
}
// Tests PrepareErrorPage wth non-post, not Off The Record error.
TEST_F(ChromeWebClientTest, PrepareErrorPageNonPostNonOtr) {
ChromeWebClient web_client;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment