Commit f357c041 authored by piman@chromium.org's avatar piman@chromium.org

Force delegated renderer on Aura

BUG=123444

Review URL: https://chromiumcodereview.appspot.com/22797008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220638 0039d316-1c4b-4281-b951-d872f2087c98
parent 80413d78
......@@ -232,6 +232,9 @@ class WebViewTest : public extensions::PlatformAppBrowserTest {
fake_speech_recognition_manager_.get());
}
// We need real contexts, otherwise the embedder doesn't composite, but the
// guest does, and that isn't an expected configuration.
UseRealGLContexts();
extensions::PlatformAppBrowserTest::SetUp();
}
......
......@@ -33,6 +33,13 @@ class WebViewInteractiveTest
mouse_click_result_(false),
first_click_(true) {}
virtual void SetUp() OVERRIDE {
// We need real contexts, otherwise the embedder doesn't composite, but the
// guest does, and that isn't an expected configuration.
UseRealGLContexts();
extensions::PlatformAppBrowserTest::SetUp();
}
void MoveMouseInsideWindowWithListener(gfx::Point point,
const std::string& message) {
ExtensionTestMessageListener move_listener(message, false);
......@@ -195,7 +202,7 @@ class WebViewInteractiveTest
const testing::TestInfo* const test_info =
testing::UnitTest::GetInstance()->current_test_info();
const std::string& prefix = "DragDropWithinWebView";
const std::string& prefix = "FLAKY_DragDropWithinWebView";
if (!strncmp(test_info->name(), prefix.c_str(), prefix.size())) {
// In the drag drop test we add 20px padding to the page body because on
// windows if we get too close to the edge of the window the resize cursor
......@@ -615,7 +622,8 @@ IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, DISABLED_PopupPositioningMoved) {
// but the tests don't work on anything except chromeos for now. This is because
// of simulating mouse drag code's dependency on platforms.
#if defined(OS_CHROMEOS)
IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, DragDropWithinWebView) {
// http://crbug.com/281001
IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, FLAKY_DragDropWithinWebView) {
SetupTest(
"web_view/dnd_within_webview",
"/extensions/platform_apps/web_view/dnd_within_webview/guest.html");
......@@ -625,10 +633,11 @@ IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, DragDropWithinWebView) {
content::RunAllPendingInMessageLoop();
base::RunLoop run_loop;
quit_closure_ = run_loop.QuitClosure();
base::MessageLoop::current()->PostTask(
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&WebViewInteractiveTest::DragTestStep1,
base::Unretained(this)));
base::Unretained(this)),
base::TimeDelta::FromMilliseconds(1000));
run_loop.Run();
}
#endif // (defined(OS_CHROMEOS))
......
......@@ -169,9 +169,11 @@ class GpuFeatureTest : public InProcessBrowserTest {
std::string trace_events_json_;
};
#if defined(OS_WIN) || defined(ADDRESS_SANITIZER)
#if defined(OS_WIN) || defined(ADDRESS_SANITIZER) || defined(USE_AURA)
// This test is flaky on Windows. http://crbug.com/177113
// Also fails under AddressSanitizer. http://crbug.com/185178
// It fundamentally doesn't test the right thing on Aura.
// http://crbug.com/280675
#define MAYBE_AcceleratedCompositingAllowed DISABLED_AcceleratedCompositingAllowed
#else
#define MAYBE_AcceleratedCompositingAllowed AcceleratedCompositingAllowed
......
......@@ -253,6 +253,9 @@ class BrowserPluginHostTest : public ContentBrowserTest {
#if defined(OS_WIN) && !defined(USE_AURA)
UseRealGLBindings();
#endif
// We need real contexts, otherwise the embedder doesn't composite, but the
// guest does, and that isn't an expected configuration.
UseRealGLContexts();
ContentBrowserTest::SetUp();
}
......
......@@ -103,4 +103,28 @@ bool IsForceCompositingModeEnabled() {
trial->group_name() == kGpuCompositingFieldTrialThreadEnabledName);
}
bool IsDelegatedRendererEnabled() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
bool enabled = false;
#if defined(USE_AURA)
// Default to true on Aura, but allow override via flags.
enabled = true;
#endif
// Flags override.
enabled |= command_line.HasSwitch(switches::kEnableDelegatedRenderer);
enabled &= !command_line.HasSwitch(switches::kDisableDelegatedRenderer);
// Needs compositing, and thread.
if (enabled &&
(!IsForceCompositingModeEnabled() || !IsThreadedCompositingEnabled())) {
enabled = false;
LOG(ERROR) << "Disabling delegated-rendering because it needs "
<< "force-compositing-mode and threaded-compositing.";
}
return enabled;
}
} // namespace content
......@@ -15,6 +15,9 @@ CONTENT_EXPORT bool IsThreadedCompositingEnabled();
// Returns true if force-compositing-mode is on (via flags or field trial).
CONTENT_EXPORT bool IsForceCompositingModeEnabled();
// Returns true if delegated-renderer is on (via flags, or platform default).
CONTENT_EXPORT bool IsDelegatedRendererEnabled();
} // namespace content
#endif // CONTENT_BROWSER_GPU_COMPOSITOR_UTIL_H_
......@@ -821,6 +821,9 @@ void RenderProcessHostImpl::AppendRendererCommandLine(
if (content::IsThreadedCompositingEnabled())
command_line->AppendSwitch(switches::kEnableThreadedCompositing);
if (content::IsDelegatedRendererEnabled())
command_line->AppendSwitch(switches::kEnableDelegatedRenderer);
GetContentClient()->browser()->AppendExtraCommandLineSwitches(
command_line, GetID());
......
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