blob: e17e9c0808b705788689af71537674ca49eb3a28 [file] [log] [blame]
[email protected]3dd52d762012-01-20 10:25:121// Copyright (c) 2012 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commit09911bf2008-07-26 23:55:294
5// This is a file for random testcases that we run into that at one point or
6// another have crashed the program.
7
8#include "chrome/test/ui/ui_test.h"
9
10#include "base/basictypes.h"
[email protected]4b68e0d2009-05-02 00:56:5711#include "base/file_path.h"
[email protected]28de7d942010-02-23 01:43:0412#include "chrome/common/chrome_switches.h"
[email protected]95edc392010-07-30 22:00:3813#include "net/base/net_util.h"
initial.commit09911bf2008-07-26 23:55:2914
15class GoogleTest : public UITest {
16 protected:
17 GoogleTest() : UITest() {
[email protected]95edc392010-07-30 22:00:3818 FilePath test_file =
19 test_data_directory_.AppendASCII("google").AppendASCII("google.html");
[email protected]c405290f2011-01-08 02:04:5920 set_homepage(GURL(net::FilePathToFileURL(test_file)).spec());
initial.commit09911bf2008-07-26 23:55:2921 }
22};
23
[email protected]dba25102011-06-12 21:01:5824// Flakily fails under Valgrind, see http://crbug.com/85863.
25#if defined(OS_MACOSX)
26#define MAYBE_Crash FLAKY_Crash
27#else
28#define MAYBE_Crash Crash
29#endif // defined(OS_MACOSX)
30TEST_F(GoogleTest, MAYBE_Crash) {
initial.commit09911bf2008-07-26 23:55:2931 std::wstring page_title = L"Google";
32
33 // Make sure the navigation succeeded.
34 EXPECT_EQ(page_title, GetActiveTabTitle());
35
36 // UITest will check if this crashed.
37}
38
39class ColumnLayout : public UITest {
40 protected:
41 ColumnLayout() : UITest() {
[email protected]95edc392010-07-30 22:00:3842 FilePath test_file = test_data_directory_.AppendASCII("columns.html");
[email protected]c405290f2011-01-08 02:04:5943 set_homepage(GURL(net::FilePathToFileURL(test_file)).spec());
initial.commit09911bf2008-07-26 23:55:2944 }
45};
46
[email protected]dba25102011-06-12 21:01:5847// Flakily fails under Valgrind, see http://crbug.com/85863.
48TEST_F(ColumnLayout, MAYBE_Crash) {
initial.commit09911bf2008-07-26 23:55:2949 std::wstring page_title = L"Column test";
50
51 // Make sure the navigation succeeded.
52 EXPECT_EQ(page_title, GetActiveTabTitle());
53
[email protected]28de7d942010-02-23 01:43:0454 // UITest will check if this crashed.
55}