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

Side by Side Diff: chrome/test/gpu/gpu_crash_browsertest.cc

Issue 10820007: Move all the layout tests that ran under browser_tests to run under content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_commands.h" 9 #include "chrome/browser/ui/browser_commands.h"
10 #include "chrome/common/chrome_paths.h" 10 #include "chrome/common/chrome_paths.h"
11 #include "chrome/common/chrome_switches.h" 11 #include "chrome/common/chrome_switches.h"
12 #include "chrome/common/url_constants.h" 12 #include "chrome/common/url_constants.h"
13 #include "chrome/test/base/in_process_browser_test.h" 13 #include "chrome/test/base/in_process_browser_test.h"
14 #include "chrome/test/base/test_launcher_utils.h" 14 #include "chrome/test/base/test_launcher_utils.h"
15 #include "chrome/test/base/ui_test_utils.h" 15 #include "chrome/test/base/ui_test_utils.h"
16 #include "content/public/test/browser_test_utils.h"
16 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
17 #include "ui/gl/gl_implementation.h" 18 #include "ui/gl/gl_implementation.h"
18 19
19 namespace { 20 namespace {
20 21
21 void SimulateGPUCrash(Browser* browser) { 22 void SimulateGPUCrash(Browser* browser) {
22 LOG(ERROR) << "SimulateGPUCrash, before NavigateToURLWithDisposition"; 23 LOG(ERROR) << "SimulateGPUCrash, before NavigateToURLWithDisposition";
23 ui_test_utils::NavigateToURLWithDisposition(browser, 24 ui_test_utils::NavigateToURLWithDisposition(browser,
24 GURL(chrome::kChromeUIGpuCrashURL), NEW_FOREGROUND_TAB, 25 GURL(chrome::kChromeUIGpuCrashURL), NEW_FOREGROUND_TAB,
25 ui_test_utils::BROWSER_TEST_NONE); 26 ui_test_utils::BROWSER_TEST_NONE);
(...skipping 17 matching lines...) Expand all
43 } 44 }
44 FilePath gpu_test_dir_; 45 FilePath gpu_test_dir_;
45 }; 46 };
46 47
47 // Currently Kill times out on GPU bots: http://crbug.com/101513 48 // Currently Kill times out on GPU bots: http://crbug.com/101513
48 IN_PROC_BROWSER_TEST_F(GPUCrashTest, DISABLED_Kill) { 49 IN_PROC_BROWSER_TEST_F(GPUCrashTest, DISABLED_Kill) {
49 ui_test_utils::DOMMessageQueue message_queue; 50 ui_test_utils::DOMMessageQueue message_queue;
50 51
51 ui_test_utils::NavigateToURL( 52 ui_test_utils::NavigateToURL(
52 browser(), 53 browser(),
53 ui_test_utils::GetFileUrlWithQuery( 54 content::GetFileUrlWithQuery(
54 gpu_test_dir_.AppendASCII("webgl.html"), "query=kill")); 55 gpu_test_dir_.AppendASCII("webgl.html"), "query=kill"));
55 SimulateGPUCrash(browser()); 56 SimulateGPUCrash(browser());
56 57
57 std::string m; 58 std::string m;
58 ASSERT_TRUE(message_queue.WaitForMessage(&m)); 59 ASSERT_TRUE(message_queue.WaitForMessage(&m));
59 EXPECT_EQ("\"SUCCESS\"", m); 60 EXPECT_EQ("\"SUCCESS\"", m);
60 } 61 }
61 62
62 63
63 IN_PROC_BROWSER_TEST_F(GPUCrashTest, WebkitLoseContext) { 64 IN_PROC_BROWSER_TEST_F(GPUCrashTest, WebkitLoseContext) {
64 ui_test_utils::DOMMessageQueue message_queue; 65 ui_test_utils::DOMMessageQueue message_queue;
65 66
66 ui_test_utils::NavigateToURL( 67 ui_test_utils::NavigateToURL(
67 browser(), 68 browser(),
68 ui_test_utils::GetFileUrlWithQuery( 69 content::GetFileUrlWithQuery(
69 gpu_test_dir_.AppendASCII("webgl.html"), 70 gpu_test_dir_.AppendASCII("webgl.html"),
70 "query=WEBGL_lose_context")); 71 "query=WEBGL_lose_context"));
71 72
72 std::string m; 73 std::string m;
73 ASSERT_TRUE(message_queue.WaitForMessage(&m)); 74 ASSERT_TRUE(message_queue.WaitForMessage(&m));
74 EXPECT_EQ("\"SUCCESS\"", m); 75 EXPECT_EQ("\"SUCCESS\"", m);
75 } 76 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698