summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-04 23:09:12 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-04 23:09:12 +0000
commit90dc3fcf77319476258855daa2b6cac5fa59a114 (patch)
tree5b75fc8bdc9e5c52345712ca54d2c25906f78789 /chrome/test
parenta4e8599648179473e375e8c6146ce9845c240ea1 (diff)
downloadchromium_src-90dc3fcf77319476258855daa2b6cac5fa59a114.zip
chromium_src-90dc3fcf77319476258855daa2b6cac5fa59a114.tar.gz
chromium_src-90dc3fcf77319476258855daa2b6cac5fa59a114.tar.bz2
Added GPUBrowserTest.BrowserTestLaunchedWithOSMesa.
This just verifies that the OpenGL backend is OSMesa and does a simple smoke test that it is functional. It is the browser test equivalent of GPUUITest.UITestLaunchedWithOSMesa. OSMesa should be required for both kinds of tests. I moved both tests into the new chrome/test/gpu directory. There are ongoing stability issues with OSMesa (and GL in general) on bots. TEST=passes locally, try BUG=none Review URL: http://codereview.chromium.org/4424001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65126 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/gpu/gpu_browsertest.cc49
-rw-r--r--chrome/test/gpu/gpu_uitest.cc (renamed from chrome/test/ui/gpu_uitest.cc)1
2 files changed, 50 insertions, 0 deletions
diff --git a/chrome/test/gpu/gpu_browsertest.cc b/chrome/test/gpu/gpu_browsertest.cc
new file mode 100644
index 0000000..71f981a
--- /dev/null
+++ b/chrome/test/gpu/gpu_browsertest.cc
@@ -0,0 +1,49 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/path_service.h"
+#include "base/string16.h"
+#include "base/utf_string_conversions.h"
+#include "build/build_config.h"
+#include "chrome/browser/browser.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/common/chrome_paths.h"
+#include "chrome/test/in_process_browser_test.h"
+#include "chrome/test/ui_test_utils.h"
+#include "googleurl/src/gurl.h"
+#include "net/base/net_util.h"
+
+class GPUBrowserTest : public InProcessBrowserTest {
+ protected:
+ GPUBrowserTest() {
+ }
+
+ virtual void SetUpInProcessBrowserTestFixture() {
+ FilePath test_dir;
+ ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir));
+ gpu_test_dir_ = test_dir.AppendASCII("gpu");
+ }
+
+ FilePath gpu_test_dir_;
+};
+
+// TODO(apatrick): OSMesa is flaky on Mac and Windows. http://crbug/61037
+#if defined(OS_WIN) || defined(OS_MACOSX)
+#define MAYBE_BrowserTestLaunchedWithOSMesa \
+ DISABLED_BrowserTestLaunchedWithOSMesa
+#else
+#define MAYBE_BrowserTestLaunchedWithOSMesa BrowserTestLaunchedWithOSMesa
+#endif
+
+IN_PROC_BROWSER_TEST_F(GPUBrowserTest, MAYBE_BrowserTestLaunchedWithOSMesa) {
+ // Check the webgl test reports success and that the renderer was OSMesa.
+ // We use OSMesa for tests in order to get consistent results across a
+ // variety of boxes.
+ ui_test_utils::NavigateToURL(
+ browser(),
+ net::FilePathToFileURL(gpu_test_dir_.AppendASCII("webgl.html")));
+
+ EXPECT_EQ(ASCIIToUTF16("SUCCESS: Mesa OffScreen"),
+ browser()->GetSelectedTabContents()->GetTitle());
+}
diff --git a/chrome/test/ui/gpu_uitest.cc b/chrome/test/gpu/gpu_uitest.cc
index f12ef04..9b6a78c 100644
--- a/chrome/test/ui/gpu_uitest.cc
+++ b/chrome/test/gpu/gpu_uitest.cc
@@ -21,6 +21,7 @@ class GPUUITest : public UITest {
FilePath gpu_test_dir_;
};
+// TODO(apatrick): OSMesa is flaky on Mac and Windows. http://crbug/61037
#if defined(OS_WIN) || defined(OS_MACOSX)
#define MAYBE_UITestLaunchedWithOSMesa DISABLED_UITestLaunchedWithOSMesa
#else