diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/content/zygote/zygote_browsertest.cc | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/content/zygote/zygote_browsertest.cc')
-rw-r--r-- | chromium/content/zygote/zygote_browsertest.cc | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/chromium/content/zygote/zygote_browsertest.cc b/chromium/content/zygote/zygote_browsertest.cc deleted file mode 100644 index 4f0de6ce3a4..00000000000 --- a/chromium/content/zygote/zygote_browsertest.cc +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2016 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 <string> -#include <vector> - -#include "base/command_line.h" -#include "base/strings/string_split.h" -#include "content/public/common/content_switches.h" -#include "content/public/test/browser_test.h" -#include "content/public/test/browser_test_utils.h" -#include "content/public/test/content_browser_test.h" -#include "content/public/test/content_browser_test_utils.h" -#include "content/shell/browser/shell.h" -#include "services/service_manager/embedder/switches.h" -#include "services/service_manager/sandbox/linux/sandbox_linux.h" -#include "services/service_manager/sandbox/switches.h" -#include "services/service_manager/zygote/common/zygote_buildflags.h" -#if BUILDFLAG(USE_ZYGOTE_HANDLE) -#include "services/service_manager/zygote/common/zygote_handle.h" -#include "services/service_manager/zygote/host/zygote_communication_linux.h" -#include "services/service_manager/zygote/host/zygote_host_impl_linux.h" -#endif - -namespace content { - -class LinuxZygoteBrowserTest : public ContentBrowserTest { - public: - LinuxZygoteBrowserTest() = default; - ~LinuxZygoteBrowserTest() override = default; - - private: - DISALLOW_COPY_AND_ASSIGN(LinuxZygoteBrowserTest); -}; - -// https://crbug.com/638303 -IN_PROC_BROWSER_TEST_F(LinuxZygoteBrowserTest, GetLocalTimeHasTimeZone) { - const char kTestCommand[] = - "window.domAutomationController.send(new Date().toString());"; - - EXPECT_TRUE(NavigateToURL(shell(), GURL("data:text/html,start page"))); - std::string result; - ASSERT_TRUE(ExecuteScriptAndExtractString(shell(), kTestCommand, &result)); - std::vector<std::string> parts = base::SplitString( - result, "()", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); - ASSERT_EQ(3U, parts.size()); - EXPECT_FALSE(parts[0].empty()); - EXPECT_FALSE(parts[1].empty()); - EXPECT_TRUE(parts[2].empty()); -} - -#if BUILDFLAG(USE_ZYGOTE_HANDLE) -IN_PROC_BROWSER_TEST_F(LinuxZygoteBrowserTest, ZygoteSandboxes) { - // We need zygotes and the standard sandbox config to run this test. - if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoZygote) || - base::CommandLine::ForCurrentProcess()->HasSwitch( - service_manager::switches::kNoSandbox)) { - return; - } - - // Sanity check the sandbox flags we expect to be everywhere. - const int flags = service_manager::GetGenericZygote()->GetSandboxStatus(); - constexpr int kExpectedFlags = service_manager::SandboxLinux::kPIDNS | - service_manager::SandboxLinux::kNetNS | - service_manager::SandboxLinux::kUserNS; - EXPECT_EQ(kExpectedFlags, flags & kExpectedFlags); - - EXPECT_EQ(service_manager::GetUnsandboxedZygote()->GetSandboxStatus(), 0); -} -#endif - -class LinuxZygoteDisabledBrowserTest : public ContentBrowserTest { - public: - LinuxZygoteDisabledBrowserTest() = default; - ~LinuxZygoteDisabledBrowserTest() override = default; - - protected: - void SetUpCommandLine(base::CommandLine* command_line) override { - ContentBrowserTest::SetUpCommandLine(command_line); - command_line->AppendSwitch(switches::kNoZygote); - command_line->AppendSwitch(service_manager::switches::kNoSandbox); - } - - private: - DISALLOW_COPY_AND_ASSIGN(LinuxZygoteDisabledBrowserTest); -}; - -// https://crbug.com/712779 -#if !defined(THREAD_SANITIZER) -// Test that the renderer doesn't crash during launch if zygote is disabled. -IN_PROC_BROWSER_TEST_F(LinuxZygoteDisabledBrowserTest, - NoCrashWhenZygoteDisabled) { - EXPECT_TRUE(NavigateToURL(shell(), GURL("data:text/html,start page"))); -} -#endif - -#if BUILDFLAG(USE_ZYGOTE_HANDLE) -IN_PROC_BROWSER_TEST_F(LinuxZygoteDisabledBrowserTest, - NoZygoteWhenZygoteDisabled) { - EXPECT_TRUE(NavigateToURL(shell(), GURL("data:text/html,start page"))); - - EXPECT_FALSE(service_manager::ZygoteHostImpl::GetInstance()->HasZygote()); -} -#endif - -} // namespace content |