| Index: content/browser/gpu/gpu_crash_browsertest.cc
|
| diff --git a/chrome/test/gpu/gpu_crash_browsertest.cc b/content/browser/gpu/gpu_crash_browsertest.cc
|
| similarity index 50%
|
| copy from chrome/test/gpu/gpu_crash_browsertest.cc
|
| copy to content/browser/gpu/gpu_crash_browsertest.cc
|
| index 1b3e445b5d80d4d01601b6a0cff74cba11f07efe..a7f6982a269176a73c6c7e8a6b759a5fa1093974 100644
|
| --- a/chrome/test/gpu/gpu_crash_browsertest.cc
|
| +++ b/content/browser/gpu/gpu_crash_browsertest.cc
|
| @@ -3,34 +3,32 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/command_line.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| #include "base/path_service.h"
|
| #include "base/utf_string_conversions.h"
|
| -#include "chrome/browser/ui/browser.h"
|
| -#include "chrome/browser/ui/browser_commands.h"
|
| -#include "chrome/common/chrome_paths.h"
|
| -#include "chrome/common/chrome_switches.h"
|
| -#include "chrome/common/url_constants.h"
|
| -#include "chrome/test/base/in_process_browser_test.h"
|
| -#include "chrome/test/base/test_launcher_utils.h"
|
| -#include "chrome/test/base/ui_test_utils.h"
|
| +#include "content/public/common/content_paths.h"
|
| +#include "content/public/common/url_constants.h"
|
| #include "content/public/test/browser_test_utils.h"
|
| +#include "content/shell/shell.h"
|
| +#include "content/test/content_browser_test.h"
|
| +#include "content/test/content_browser_test_utils.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "ui/gl/gl_implementation.h"
|
|
|
| namespace {
|
|
|
| -void SimulateGPUCrash(Browser* browser) {
|
| - LOG(ERROR) << "SimulateGPUCrash, before NavigateToURLWithDisposition";
|
| - ui_test_utils::NavigateToURLWithDisposition(browser,
|
| - GURL(chrome::kChromeUIGpuCrashURL), NEW_FOREGROUND_TAB,
|
| - ui_test_utils::BROWSER_TEST_NONE);
|
| - chrome::SelectPreviousTab(browser);
|
| - LOG(ERROR) << "SimulateGPUCrash, after CloseTab";
|
| +// SimulateGPUCrash owns the passed 'shell', this should be
|
| +// other than the main one
|
| +void SimulateGPUCrash(content::Shell* s) {
|
| + LOG(ERROR) << "SimulateGPUCrash, before NavigateToURL";
|
| + s->LoadURL(GURL(chrome::kChromeUIGpuCrashURL));
|
| + LOG(ERROR) << "SimulateGPUCrash, after NavigateToURL";
|
| }
|
|
|
| } // namespace
|
|
|
| -class GPUCrashTest : public InProcessBrowserTest {
|
| +namespace content {
|
| +class GPUCrashTest : public ContentBrowserTest {
|
| protected:
|
| virtual void SetUpCommandLine(CommandLine* command_line) {
|
| // GPU tests require gpu acceleration.
|
| @@ -39,21 +37,22 @@ class GPUCrashTest : public InProcessBrowserTest {
|
| }
|
| virtual void SetUpInProcessBrowserTestFixture() {
|
| FilePath test_dir;
|
| - ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir));
|
| + ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &test_dir));
|
| gpu_test_dir_ = test_dir.AppendASCII("gpu");
|
| }
|
| FilePath gpu_test_dir_;
|
| };
|
|
|
| // Currently Kill times out on GPU bots: http://crbug.com/101513
|
| -IN_PROC_BROWSER_TEST_F(GPUCrashTest, DISABLED_Kill) {
|
| - content::DOMMessageQueue message_queue;
|
| +IN_PROC_BROWSER_TEST_F(GPUCrashTest, MANUAL_DISABLED_Kill) {
|
| + DOMMessageQueue message_queue;
|
|
|
| - ui_test_utils::NavigateToURL(
|
| - browser(),
|
| - content::GetFileUrlWithQuery(
|
| + NavigateToURL(
|
| + shell(),
|
| + GetFileUrlWithQuery(
|
| gpu_test_dir_.AppendASCII("webgl.html"), "query=kill"));
|
| - SimulateGPUCrash(browser());
|
| + scoped_ptr<Shell> shell(CreateBrowser());
|
| + SimulateGPUCrash(shell.get());
|
|
|
| std::string m;
|
| ASSERT_TRUE(message_queue.WaitForMessage(&m));
|
| @@ -61,12 +60,12 @@ IN_PROC_BROWSER_TEST_F(GPUCrashTest, DISABLED_Kill) {
|
| }
|
|
|
|
|
| -IN_PROC_BROWSER_TEST_F(GPUCrashTest, WebkitLoseContext) {
|
| - content::DOMMessageQueue message_queue;
|
| +IN_PROC_BROWSER_TEST_F(GPUCrashTest, MANUAL_WebkitLoseContext) {
|
| + DOMMessageQueue message_queue;
|
|
|
| - ui_test_utils::NavigateToURL(
|
| - browser(),
|
| - content::GetFileUrlWithQuery(
|
| + NavigateToURL(
|
| + shell(),
|
| + GetFileUrlWithQuery(
|
| gpu_test_dir_.AppendASCII("webgl.html"),
|
| "query=WEBGL_lose_context"));
|
|
|
| @@ -74,3 +73,5 @@ IN_PROC_BROWSER_TEST_F(GPUCrashTest, WebkitLoseContext) {
|
| ASSERT_TRUE(message_queue.WaitForMessage(&m));
|
| EXPECT_EQ("\"SUCCESS\"", m);
|
| }
|
| +
|
| +} // namespace content
|
|
|