1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "base/basictypes.h" 6 #include "base/file_path.h" 7 #include "build/build_config.h" 8 #include "chrome/test/ui/ui_test.h" 9 #include "net/base/net_util.h" 10 11 class IFrameTest : public UITest { 12 protected: 13 void NavigateAndVerifyTitle(const char* url, const wchar_t* page_title) { 14 FilePath test_file(test_data_directory_); 15 test_file = test_file.AppendASCII(url); 16 17 NavigateToURL(net::FilePathToFileURL(test_file)); 18 EXPECT_EQ(std::wstring(page_title), GetActiveTabTitle()); 19 } 20 }; 21 22 TEST_F(IFrameTest, Crash) { 23 NavigateAndVerifyTitle("iframe.html", L"iframe test"); 24 } 25 26 TEST_F(IFrameTest, InEmptyFrame) { 27 NavigateAndVerifyTitle("iframe_in_empty_frame.html", L"iframe test"); 28 } 29