Commit a9ac93df authored by Guillaume Jenkins's avatar Guillaume Jenkins Committed by Commit Bot

[Spellcheck] Move spell check site isolation tests to own file

As mentioned in code review feedback on another spell check CL, the site
isolation browser test file is getting large, and spell check stuff
takes a good chunk of it.

This CL moves the spell check site isolation tests to their own file,
which is not compiled if spell check is not enabled. The CL also moves
a base test class to its own .h and .cc files, since both the non-spell
check and the spell check tests inherit from it.

Other CL for context:
https://chromium-review.googlesource.com/c/chromium/src/+/1918277

Change-Id: Iaea04af280859e42f916667c767a72ddaefcef92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1945276
Commit-Queue: Guillaume Jenkins <gujen@google.com>
Reviewed-by: default avatarŁukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721120}
parent 858c8228
// 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 "chrome_site_per_process_test.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_utils.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
ChromeSitePerProcessTest::ChromeSitePerProcessTest() {}
ChromeSitePerProcessTest::~ChromeSitePerProcessTest() {}
void ChromeSitePerProcessTest::SetUpCommandLine(
base::CommandLine* command_line) {
content::IsolateAllSitesForTesting(command_line);
}
void ChromeSitePerProcessTest::SetUpOnMainThread() {
host_resolver()->AddRule("*", "127.0.0.1");
ASSERT_TRUE(embedded_test_server()->InitializeAndListen());
content::SetupCrossSiteRedirector(embedded_test_server());
// Serve from the root so that flash_object.html can load the swf file.
// Needed for the PluginWithRemoteTopFrame test.
base::FilePath test_data_dir;
CHECK(base::PathService::Get(base::DIR_SOURCE_ROOT, &test_data_dir));
embedded_test_server()->ServeFilesFromDirectory(test_data_dir);
// Add content/test/data for cross_site_iframe_factory.html
embedded_test_server()->ServeFilesFromSourceDirectory("content/test/data");
embedded_test_server()->StartAcceptingConnections();
}
// 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.
#ifndef CHROME_BROWSER_SITE_ISOLATION_CHROME_SITE_PER_PROCESS_TEST_H_
#define CHROME_BROWSER_SITE_ISOLATION_CHROME_SITE_PER_PROCESS_TEST_H_
#include "base/macros.h"
#include "chrome/test/base/in_process_browser_test.h"
namespace base {
class CommandLine;
} // namespace base
class ChromeSitePerProcessTest : public InProcessBrowserTest {
public:
ChromeSitePerProcessTest();
~ChromeSitePerProcessTest() override;
void SetUpCommandLine(base::CommandLine* command_line) override;
void SetUpOnMainThread() override;
private:
DISALLOW_COPY_AND_ASSIGN(ChromeSitePerProcessTest);
};
#endif // CHROME_BROWSER_SITE_ISOLATION_CHROME_SITE_PER_PROCESS_TEST_H_
......@@ -1146,6 +1146,8 @@ if (!is_android) {
"../browser/signin/e2e_tests/live_test.cc",
"../browser/signin/e2e_tests/live_test.h",
"../browser/site_isolation/chrome_site_per_process_browsertest.cc",
"../browser/site_isolation/chrome_site_per_process_test.cc",
"../browser/site_isolation/chrome_site_per_process_test.h",
"../browser/site_isolation/site_details_browsertest.cc",
"../browser/ssl/known_interception_disclosure_ui_browsertest.cc",
"../browser/ui/blocked_content/popup_tracker_browsertest.cc",
......@@ -2710,6 +2712,11 @@ if (!is_android) {
if (enable_webui_tab_strip) {
sources += [ "../browser/ui/webui/tab_strip/tab_strip_ui_browsertest.cc" ]
}
if (enable_spellcheck) {
sources +=
[ "../browser/site_isolation/spellcheck_per_process_browsertest.cc" ]
}
}
}
......
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