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

Unified Diff: chrome/test/gpu/gpu_crash_browsertest.cc

Issue 11378008: Raise an infobar and deny access to WebGL if a GPU reset was detected while a web page containing W… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Work around build failure on Mac OS with 10.6 SDK. Created 8 years, 1 month 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/chrome_browser.gypi ('k') | content/browser/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/gpu/gpu_crash_browsertest.cc
diff --git a/chrome/test/gpu/gpu_crash_browsertest.cc b/chrome/test/gpu/gpu_crash_browsertest.cc
index 94fa01b9719e803e85ba4952b7fd43394388f1d4..569be6690564a339c7bc3ae99dc40fcce97c57a1 100644
--- a/chrome/test/gpu/gpu_crash_browsertest.cc
+++ b/chrome/test/gpu/gpu_crash_browsertest.cc
@@ -5,15 +5,19 @@
#include "base/command_line.h"
#include "base/path_service.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_navigator.h"
+#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/common/chrome_notification_types.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/browser/gpu_data_manager.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/common/content_paths.h"
@@ -60,6 +64,9 @@ class GPUCrashTest : public InProcessBrowserTest {
IN_PROC_BROWSER_TEST_F(GPUCrashTest, Kill) {
content::DOMMessageQueue message_queue;
+ content::GpuDataManager::GetInstance()->
+ DisableDomainBlockingFor3DAPIsForTesting();
+
// Load page and wait for it to load.
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
@@ -77,6 +84,26 @@ IN_PROC_BROWSER_TEST_F(GPUCrashTest, Kill) {
EXPECT_EQ("\"SUCCESS\"", m);
}
+IN_PROC_BROWSER_TEST_F(GPUCrashTest, ContextLossRaisesInfobar) {
+ // Load page and wait for it to load.
+ content::WindowedNotificationObserver observer(
+ content::NOTIFICATION_LOAD_STOP,
+ content::NotificationService::AllSources());
+ ui_test_utils::NavigateToURL(
+ browser(),
+ content::GetFileUrlWithQuery(
+ gpu_test_dir_.AppendASCII("webgl.html"), "query=kill"));
+ observer.Wait();
+
+ content::WindowedNotificationObserver infobar_added(
+ chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED,
+ content::NotificationService::AllSources());
+ SimulateGPUCrash(browser());
+ infobar_added.Wait();
+ EXPECT_EQ(1u,
+ InfoBarTabHelper::FromWebContents(
+ chrome::GetActiveWebContents(browser()))->GetInfoBarCount());
+}
IN_PROC_BROWSER_TEST_F(GPUCrashTest, WebkitLoseContext) {
content::DOMMessageQueue message_queue;
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | content/browser/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698