blob: bc69358481c73a9fd94214d3aeccfc2d1f0ed67b [file] [log] [blame]
[email protected]d2e787062011-02-05 06:04:491// Copyright (c) 2011 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#include "base/basictypes.h"
[email protected]72cbd322009-04-07 10:17:126#include "base/file_path.h"
[email protected]8f165b82009-04-08 18:18:257#include "build/build_config.h"
initial.commit09911bf2008-07-26 23:55:298#include "chrome/test/ui/ui_test.h"
9#include "net/base/net_util.h"
10
11class IFrameTest : public UITest {
12 protected:
[email protected]72cbd322009-04-07 10:17:1213 void NavigateAndVerifyTitle(const char* url, const wchar_t* page_title) {
[email protected]4b68e0d2009-05-02 00:56:5714 FilePath test_file(test_data_directory_);
[email protected]72cbd322009-04-07 10:17:1215 test_file = test_file.AppendASCII(url);
initial.commit09911bf2008-07-26 23:55:2916
[email protected]8ac1a752008-07-31 19:40:3717 NavigateToURL(net::FilePathToFileURL(test_file));
initial.commit09911bf2008-07-26 23:55:2918 EXPECT_EQ(std::wstring(page_title), GetActiveTabTitle());
initial.commit09911bf2008-07-26 23:55:2919 }
initial.commit09911bf2008-07-26 23:55:2920};
21
22TEST_F(IFrameTest, Crash) {
[email protected]72cbd322009-04-07 10:17:1223 NavigateAndVerifyTitle("iframe.html", L"iframe test");
initial.commit09911bf2008-07-26 23:55:2924}
25
[email protected]f531a3e2011-10-14 00:05:0726TEST_F(IFrameTest, InEmptyFrame) {
[email protected]72cbd322009-04-07 10:17:1227 NavigateAndVerifyTitle("iframe_in_empty_frame.html", L"iframe test");
initial.commit09911bf2008-07-26 23:55:2928}