Commit 4272e0fd authored by Patrick Monette's avatar Patrick Monette Committed by Commit Bot

Remove useless references to unsupported windows versions (3)

This CL goes over the content/ directory.

Bug: 579196, 304193
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I8e87c220e424ff469c42abc09fa86746176b1812
Reviewed-on: https://chromium-review.googlesource.com/565944Reviewed-by: default avatarJames Forshaw <forshaw@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486891}
parent 2802973e
...@@ -26,11 +26,6 @@ ...@@ -26,11 +26,6 @@
#include "third_party/WebKit/public/web/WebSandboxFlags.h" #include "third_party/WebKit/public/web/WebSandboxFlags.h"
#include "url/url_constants.h" #include "url/url_constants.h"
// For fine-grained suppression on flaky tests.
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#endif
namespace content { namespace content {
namespace { namespace {
...@@ -168,11 +163,6 @@ IN_PROC_BROWSER_TEST_F(FrameTreeBrowserTest, FrameTreeAfterCrash) { ...@@ -168,11 +163,6 @@ IN_PROC_BROWSER_TEST_F(FrameTreeBrowserTest, FrameTreeAfterCrash) {
#define MAYBE_NavigateWithLeftoverFrames NavigateWithLeftoverFrames #define MAYBE_NavigateWithLeftoverFrames NavigateWithLeftoverFrames
#endif #endif
IN_PROC_BROWSER_TEST_F(FrameTreeBrowserTest, MAYBE_NavigateWithLeftoverFrames) { IN_PROC_BROWSER_TEST_F(FrameTreeBrowserTest, MAYBE_NavigateWithLeftoverFrames) {
#if defined(OS_WIN)
// Flaky on XP bot http://crbug.com/468713
if (base::win::GetVersion() <= base::win::VERSION_XP)
return;
#endif
GURL base_url = embedded_test_server()->GetURL("A.com", "/site_isolation/"); GURL base_url = embedded_test_server()->GetURL("A.com", "/site_isolation/");
NavigateToURL(shell(), NavigateToURL(shell(),
......
...@@ -78,7 +78,6 @@ ...@@ -78,7 +78,6 @@
#endif #endif
#if defined(OS_WIN) #if defined(OS_WIN)
#include "base/win/windows_version.h"
#include "content/common/sandbox_win.h" #include "content/common/sandbox_win.h"
#include "sandbox/win/src/sandbox_policy.h" #include "sandbox/win/src/sandbox_policy.h"
#include "ui/gfx/switches.h" #include "ui/gfx/switches.h"
...@@ -260,38 +259,31 @@ class GpuSandboxedProcessLauncherDelegate ...@@ -260,38 +259,31 @@ class GpuSandboxedProcessLauncherDelegate
// backend. Note that the GPU process is connected to the interactive // backend. Note that the GPU process is connected to the interactive
// desktop. // desktop.
bool PreSpawnTarget(sandbox::TargetPolicy* policy) override { bool PreSpawnTarget(sandbox::TargetPolicy* policy) override {
if (base::win::GetVersion() > base::win::VERSION_XP) { if (cmd_line_.GetSwitchValueASCII(switches::kUseGL) ==
if (cmd_line_.GetSwitchValueASCII(switches::kUseGL) == gl::kGLImplementationDesktopName) {
gl::kGLImplementationDesktopName) { // Open GL path.
// Open GL path. policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS,
policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS, sandbox::USER_LIMITED);
sandbox::USER_LIMITED);
SetJobLevel(cmd_line_, sandbox::JOB_UNPROTECTED, 0, policy);
policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW);
} else {
policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS,
sandbox::USER_LIMITED);
// UI restrictions break when we access Windows from outside our job.
// However, we don't want a proxy window in this process because it can
// introduce deadlocks where the renderer blocks on the gpu, which in
// turn blocks on the browser UI thread. So, instead we forgo a window
// message pump entirely and just add job restrictions to prevent child
// processes.
SetJobLevel(cmd_line_,
sandbox::JOB_LIMITED_USER,
JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS |
JOB_OBJECT_UILIMIT_DESKTOP |
JOB_OBJECT_UILIMIT_EXITWINDOWS |
JOB_OBJECT_UILIMIT_DISPLAYSETTINGS,
policy);
policy->SetIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW);
}
} else {
SetJobLevel(cmd_line_, sandbox::JOB_UNPROTECTED, 0, policy); SetJobLevel(cmd_line_, sandbox::JOB_UNPROTECTED, 0, policy);
policy->SetTokenLevel(sandbox::USER_UNPROTECTED, policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW);
} else {
policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS,
sandbox::USER_LIMITED); sandbox::USER_LIMITED);
// UI restrictions break when we access Windows from outside our job.
// However, we don't want a proxy window in this process because it can
// introduce deadlocks where the renderer blocks on the gpu, which in
// turn blocks on the browser UI thread. So, instead we forgo a window
// message pump entirely and just add job restrictions to prevent child
// processes.
SetJobLevel(cmd_line_, sandbox::JOB_LIMITED_USER,
JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS |
JOB_OBJECT_UILIMIT_DESKTOP |
JOB_OBJECT_UILIMIT_EXITWINDOWS |
JOB_OBJECT_UILIMIT_DISPLAYSETTINGS,
policy);
policy->SetIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW);
} }
// Allow the server side of GPU sockets, which are pipes that have // Allow the server side of GPU sockets, which are pipes that have
......
...@@ -49,10 +49,6 @@ ...@@ -49,10 +49,6 @@
#include "ui/events/event_utils.h" #include "ui/events/event_utils.h"
#include "ui/events/test/event_generator.h" #include "ui/events/test/event_generator.h"
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#endif
namespace { namespace {
// TODO(tdresser): Find a way to avoid sleeping like this. See crbug.com/405282 // TODO(tdresser): Find a way to avoid sleeping like this. See crbug.com/405282
...@@ -639,14 +635,6 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, ...@@ -639,14 +635,6 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest,
#define MAYBE_OverscrollScreenshot OverscrollScreenshot #define MAYBE_OverscrollScreenshot OverscrollScreenshot
#endif #endif
IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, MAYBE_OverscrollScreenshot) { IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, MAYBE_OverscrollScreenshot) {
// Disable the test for WinXP. See http://crbug/294116.
#if defined(OS_WIN)
if (base::win::GetVersion() < base::win::VERSION_VISTA) {
LOG(WARNING) << "Test disabled due to unknown bug on WinXP.";
return;
}
#endif
ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/overscroll_navigation.html")); ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/overscroll_navigation.html"));
WebContentsImpl* web_contents = WebContentsImpl* web_contents =
static_cast<WebContentsImpl*>(shell()->web_contents()); static_cast<WebContentsImpl*>(shell()->web_contents());
......
...@@ -409,22 +409,10 @@ sandbox::ResultCode AddPolicyForSandboxedProcess( ...@@ -409,22 +409,10 @@ sandbox::ResultCode AddPolicyForSandboxedProcess(
if (result != sandbox::SBOX_ALL_OK) if (result != sandbox::SBOX_ALL_OK)
return result; return result;
// Close the proxy settings on XP. // On 2003/Vista+ the initial token has to be restricted if the main
if (base::win::GetVersion() <= base::win::VERSION_SERVER_2003) // token is restricted.
result = policy->AddKernelObjectToClose(L"Key", result = policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS,
L"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\" \ sandbox::USER_LOCKDOWN);
L"CurrentVersion\\Internet Settings");
if (result != sandbox::SBOX_ALL_OK)
return result;
sandbox::TokenLevel initial_token = sandbox::USER_UNPROTECTED;
if (base::win::GetVersion() > base::win::VERSION_XP) {
// On 2003/Vista the initial token has to be restricted if the main
// token is restricted.
initial_token = sandbox::USER_RESTRICTED_SAME_ACCESS;
}
result = policy->SetTokenLevel(initial_token, sandbox::USER_LOCKDOWN);
if (result != sandbox::SBOX_ALL_OK) if (result != sandbox::SBOX_ALL_OK)
return result; return result;
// Prevents the renderers from manipulating low-integrity processes. // Prevents the renderers from manipulating low-integrity processes.
......
...@@ -11,10 +11,6 @@ ...@@ -11,10 +11,6 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "ppapi/shared_impl/ppapi_preferences.h" #include "ppapi/shared_impl/ppapi_preferences.h"
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#endif
#define UMA_HISTOGRAM_ASPECT_RATIO(name, width, height) \ #define UMA_HISTOGRAM_ASPECT_RATIO(name, width, height) \
UMA_HISTOGRAM_SPARSE_SLOWLY( \ UMA_HISTOGRAM_SPARSE_SLOWLY( \
name, (height) ? ((width)*100) / (height) : kInfiniteRatio); name, (height) ? ((width)*100) / (height) : kInfiniteRatio);
...@@ -84,7 +80,6 @@ void SetGPUHistogram(const ppapi::Preferences& prefs, ...@@ -84,7 +80,6 @@ void SetGPUHistogram(const ppapi::Preferences& prefs,
// run Stage3D content on machines that have it blacklisted. // run Stage3D content on machines that have it blacklisted.
#if defined(OS_WIN) #if defined(OS_WIN)
bool needs_gpu = false; bool needs_gpu = false;
bool is_xp = base::win::GetVersion() <= base::win::VERSION_XP;
for (size_t i = 0; i < arg_names.size(); i++) { for (size_t i = 0; i < arg_names.size(); i++) {
if (arg_names[i] == "wmode") { if (arg_names[i] == "wmode") {
...@@ -99,12 +94,8 @@ void SetGPUHistogram(const ppapi::Preferences& prefs, ...@@ -99,12 +94,8 @@ void SetGPUHistogram(const ppapi::Preferences& prefs,
// 1 : No 3D content and GPU is not blacklisted // 1 : No 3D content and GPU is not blacklisted
// 2 : 3D content but GPU is blacklisted // 2 : 3D content but GPU is blacklisted
// 3 : 3D content and GPU is not blacklisted // 3 : 3D content and GPU is not blacklisted
// 4 : No 3D content and GPU is blacklisted on XP UMA_HISTOGRAM_ENUMERATION("Flash.UsesGPU",
// 5 : No 3D content and GPU is not blacklisted on XP needs_gpu * 2 + prefs.is_webgl_supported, 8);
// 6 : 3D content but GPU is blacklisted on XP
// 7 : 3D content and GPU is not blacklisted on XP
UMA_HISTOGRAM_ENUMERATION(
"Flash.UsesGPU", is_xp * 4 + needs_gpu * 2 + prefs.is_webgl_supported, 8);
#endif #endif
} }
......
...@@ -1178,7 +1178,7 @@ TEST_F(RenderViewImplTest, ImeComposition) { ...@@ -1178,7 +1178,7 @@ TEST_F(RenderViewImplTest, ImeComposition) {
const wchar_t* result; const wchar_t* result;
}; };
static const ImeMessage kImeMessages[] = { static const ImeMessage kImeMessages[] = {
// Scenario 1: input a Chinese word with Microsoft IME (on Vista). // Scenario 1: input a Chinese word with Microsoft IME.
{IME_INITIALIZE, true, 0, 0, NULL, NULL}, {IME_INITIALIZE, true, 0, 0, NULL, NULL},
{IME_SETINPUTMODE, true, 0, 0, NULL, NULL}, {IME_SETINPUTMODE, true, 0, 0, NULL, NULL},
{IME_SETFOCUS, true, 0, 0, NULL, NULL}, {IME_SETFOCUS, true, 0, 0, NULL, NULL},
...@@ -1188,7 +1188,7 @@ TEST_F(RenderViewImplTest, ImeComposition) { ...@@ -1188,7 +1188,7 @@ TEST_F(RenderViewImplTest, ImeComposition) {
{IME_SETCOMPOSITION, false, 4, 4, L"niha", L"niha"}, {IME_SETCOMPOSITION, false, 4, 4, L"niha", L"niha"},
{IME_SETCOMPOSITION, false, 5, 5, L"nihao", L"nihao"}, {IME_SETCOMPOSITION, false, 5, 5, L"nihao", L"nihao"},
{IME_COMMITTEXT, false, -1, -1, L"\x4F60\x597D", L"\x4F60\x597D"}, {IME_COMMITTEXT, false, -1, -1, L"\x4F60\x597D", L"\x4F60\x597D"},
// Scenario 2: input a Japanese word with Microsoft IME (on Vista). // Scenario 2: input a Japanese word with Microsoft IME.
{IME_INITIALIZE, true, 0, 0, NULL, NULL}, {IME_INITIALIZE, true, 0, 0, NULL, NULL},
{IME_SETINPUTMODE, true, 0, 0, NULL, NULL}, {IME_SETINPUTMODE, true, 0, 0, NULL, NULL},
{IME_SETFOCUS, true, 0, 0, NULL, NULL}, {IME_SETFOCUS, true, 0, 0, NULL, NULL},
...@@ -1203,7 +1203,7 @@ TEST_F(RenderViewImplTest, ImeComposition) { ...@@ -1203,7 +1203,7 @@ TEST_F(RenderViewImplTest, ImeComposition) {
{IME_SETCOMPOSITION, false, 0, 2, L"\x6F22\x5B57", L"\x6F22\x5B57"}, {IME_SETCOMPOSITION, false, 0, 2, L"\x6F22\x5B57", L"\x6F22\x5B57"},
{IME_FINISHCOMPOSINGTEXT, false, -1, -1, L"", L"\x6F22\x5B57"}, {IME_FINISHCOMPOSINGTEXT, false, -1, -1, L"", L"\x6F22\x5B57"},
{IME_CANCELCOMPOSITION, false, -1, -1, L"", L"\x6F22\x5B57"}, {IME_CANCELCOMPOSITION, false, -1, -1, L"", L"\x6F22\x5B57"},
// Scenario 3: input a Korean word with Microsot IME (on Vista). // Scenario 3: input a Korean word with Microsot IME.
{IME_INITIALIZE, true, 0, 0, NULL, NULL}, {IME_INITIALIZE, true, 0, 0, NULL, NULL},
{IME_SETINPUTMODE, true, 0, 0, NULL, NULL}, {IME_SETINPUTMODE, true, 0, 0, NULL, NULL},
{IME_SETFOCUS, true, 0, 0, NULL, NULL}, {IME_SETFOCUS, true, 0, 0, NULL, NULL},
...@@ -1498,12 +1498,6 @@ TEST_F(RenderViewImplTest, TestBackForward) { ...@@ -1498,12 +1498,6 @@ TEST_F(RenderViewImplTest, TestBackForward) {
#if defined(OS_MACOSX) || defined(USE_AURA) #if defined(OS_MACOSX) || defined(USE_AURA)
TEST_F(RenderViewImplTest, GetCompositionCharacterBoundsTest) { TEST_F(RenderViewImplTest, GetCompositionCharacterBoundsTest) {
#if defined(OS_WIN)
// http://crbug.com/304193
if (base::win::GetVersion() < base::win::VERSION_VISTA)
return;
#endif
LoadHTML("<textarea id=\"test\" cols=\"100\"></textarea>"); LoadHTML("<textarea id=\"test\" cols=\"100\"></textarea>");
ExecuteJavaScriptForTests("document.getElementById('test').focus();"); ExecuteJavaScriptForTests("document.getElementById('test').focus();");
......
...@@ -25,10 +25,6 @@ ...@@ -25,10 +25,6 @@
#include "content/shell/common/shell_switches.h" #include "content/shell/common/shell_switches.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#endif
namespace content { namespace content {
// Disabled on official builds because symbolization in sandboxes processes // Disabled on official builds because symbolization in sandboxes processes
...@@ -73,13 +69,6 @@ IN_PROC_BROWSER_TEST_F(ContentBrowserTest, MANUAL_RendererCrash) { ...@@ -73,13 +69,6 @@ IN_PROC_BROWSER_TEST_F(ContentBrowserTest, MANUAL_RendererCrash) {
// Tests that browser tests print the callstack when a child process crashes. // Tests that browser tests print the callstack when a child process crashes.
IN_PROC_BROWSER_TEST_F(ContentBrowserTest, RendererCrashCallStack) { IN_PROC_BROWSER_TEST_F(ContentBrowserTest, RendererCrashCallStack) {
#if defined(OS_WIN)
// Matches the same condition in RouteStdioToConsole, which makes this test
// fail on XP.
if (base::win::GetVersion() < base::win::VERSION_VISTA)
return;
#endif
base::ThreadRestrictions::ScopedAllowIO allow_io_for_temp_dir; base::ThreadRestrictions::ScopedAllowIO allow_io_for_temp_dir;
base::ScopedTempDir temp_dir; base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
......
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