Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(937)

Unified Diff: content/browser/gpu/gpu_crash_browsertest.cc

Issue 10984040: Enable gpu crash tests in content (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: comments removal Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/gpu/gpu_crash_browsertest.cc ('k') | content/content_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8638867d00fff9e92835a72dbf63e11687b955c6 100644
--- a/chrome/test/gpu/gpu_crash_browsertest.cc
+++ b/content/browser/gpu/gpu_crash_browsertest.cc
@@ -3,34 +3,30 @@
// 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);
Zhenyao Mo 2012/10/22 22:54:33 This behavior is lost in the new test. Is there a
yongsheng 2012/10/23 05:51:42 there is no function in shell to activate one. Fro
jam 2012/10/24 20:13:04 what does the SelectPreviousTab call give us?
- LOG(ERROR) << "SimulateGPUCrash, after CloseTab";
+void SimulateGPUCrash(content::Shell* s) {
+ LOG(ERROR) << "SimulateGPUCrash, before LoadURL";
+ s->LoadURL(GURL(chrome::kChromeUIGpuCrashURL));
+ LOG(ERROR) << "SimulateGPUCrash, after LoadURL";
}
} // 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 +35,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) {
Zhenyao Mo 2012/10/22 22:54:33 Remove DISABLED_
yongsheng 2012/10/23 05:51:42 done.
+ 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 +58,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 +71,5 @@ IN_PROC_BROWSER_TEST_F(GPUCrashTest, WebkitLoseContext) {
ASSERT_TRUE(message_queue.WaitForMessage(&m));
EXPECT_EQ("\"SUCCESS\"", m);
}
+
+} // namespace content
« no previous file with comments | « chrome/test/gpu/gpu_crash_browsertest.cc ('k') | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698