Commit 9293e51a authored by Ted Choc's avatar Ted Choc Committed by Commit Bot

Revert "Add browser test for TrustableBundledExchangesFile"

This reverts commit e82de9ba.

Reason for revert: crbug.com/1000677

Original change's description:
> Add browser test for TrustableBundledExchangesFile
> 
> Bug: 966753
> Change-Id: If6a23e14c62f5ac1639a7eb9096314c13104f9b8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1784259
> Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
> Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#693091}

TBR=horo@chromium.org,ksakamoto@chromium.org

Change-Id: Iddbd2794d3bd7d98e76b28c9ac0a7f9b6a62f609
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 966753
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1783644Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693189}
parent 2fc7db57
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/shell/browser/shell.h"
#include "net/base/filename_util.h"
namespace content {
namespace {
class TestBrowserClient : public ContentBrowserClient {
public:
TestBrowserClient() = default;
~TestBrowserClient() override = default;
bool CanAcceptUntrustedExchangesIfNeeded() override { return true; }
private:
DISALLOW_COPY_AND_ASSIGN(TestBrowserClient);
};
} // namespace
class BundledExchangesTrustableFileBrowserTest : public ContentBrowserTest {
protected:
BundledExchangesTrustableFileBrowserTest()
: test_data_path_(GetTestDataPath()) {}
~BundledExchangesTrustableFileBrowserTest() override = default;
void SetUpOnMainThread() override {
original_client_ = SetBrowserClientForTesting(&browser_client_);
ContentBrowserTest::SetUpOnMainThread();
}
void SetUpCommandLine(base::CommandLine* command_line) override {
command_line->AppendSwitchPath(switches::kTrustableBundledExchangesFile,
test_data_path());
}
void TearDownOnMainThread() override {
ContentBrowserTest::TearDownOnMainThread();
if (original_client_)
SetBrowserClientForTesting(original_client_);
}
const base::FilePath& test_data_path() const { return test_data_path_; }
private:
base::FilePath GetTestDataPath() {
base::FilePath test_data_dir;
CHECK(base::PathService::Get(base::DIR_SOURCE_ROOT, &test_data_dir));
return test_data_dir.AppendASCII("services")
.AppendASCII("test")
.AppendASCII("data")
.AppendASCII("bundled_exchanges")
.AppendASCII("hello.wbn");
}
TestBrowserClient browser_client_;
ContentBrowserClient* original_client_;
const base::FilePath test_data_path_;
DISALLOW_COPY_AND_ASSIGN(BundledExchangesTrustableFileBrowserTest);
};
IN_PROC_BROWSER_TEST_F(BundledExchangesTrustableFileBrowserTest,
TrustableBundledExchangesFile) {
base::string16 expected_title = base::ASCIIToUTF16("Done");
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_TRUE(NavigateToURL(shell()->web_contents(),
net::FilePathToFileURL(test_data_path()),
GURL("https://test.example.org/")));
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
}
} // namespace content
......@@ -26,6 +26,8 @@ class NavigationLoaderInterceptor;
// A class to provide interfaces to communicate with a BundledExchanges for
// loading. Running on the UI thread.
// TODO(crbug.com/966753): Add browser tests once core parts are submitted and
// basic sequence can pass.
class BundledExchangesHandle final {
public:
BundledExchangesHandle();
......
......@@ -1039,7 +1039,6 @@ test("content_browsertests") {
"../browser/web_contents/web_contents_impl_browsertest.cc",
"../browser/web_contents/web_contents_view_aura_browsertest.cc",
"../browser/web_contents_binding_set_browsertest.cc",
"../browser/web_package/bundled_exchanges_browsertest.cc",
"../browser/web_package/signed_exchange_request_handler_browsertest.cc",
"../browser/web_package/signed_exchange_subresource_prefetch_browsertest.cc",
"../browser/webkit_browsertest.cc",
......@@ -1230,7 +1229,6 @@ test("content_browsertests") {
"$root_out_dir/content_shell.pak",
"data/",
"//media/test/data/",
"//services/test/data/",
]
}
......
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