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

Unified Diff: chrome/browser/magic_iframe_browsertest.cc

Issue 7550021: Add a browsertest for magic iframe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: now moved method outside of the class Created 9 years, 4 months 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 | « no previous file | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/magic_iframe_browsertest.cc
diff --git a/chrome/browser/magic_iframe_browsertest.cc b/chrome/browser/magic_iframe_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..06f122b06d0177f6de5532a9e079b50a143de840
--- /dev/null
+++ b/chrome/browser/magic_iframe_browsertest.cc
@@ -0,0 +1,53 @@
+// Copyright (c) 2011 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/command_line.h"
+#include "base/file_path.h"
+#include "base/file_util.h"
+#include "base/memory/ref_counted.h"
+#include "base/scoped_temp_dir.h"
+#include "base/test/thread_test_helper.h"
+#include "base/utf_string_conversions.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/testing_profile.h"
+#include "chrome/test/base/ui_test_utils.h"
+#include "content/browser/tab_contents/tab_contents.h"
+#include "content/common/content_switches.h"
+
+class MagicIframeBrowserTest : public InProcessBrowserTest {
+ public:
+ MagicIframeBrowserTest() {
+ EnableDOMAutomation();
+ }
+
+ GURL GetTestURL(const std::string& path);
+};
+
+GURL MagicIframeBrowserTest::GetTestURL(const std::string& path) {
+ std::string url_path = "files/magic_iframe/";
+ url_path.append(path);
+ return test_server()->GetURL(url_path);
+}
+
+// Verifies that reparenting of iframe between different pages works as
+// expected, including smooth transfer of resources that are still being loaded.
+// The test failure manifests as the ongoing XHR request is not finishing
+// (silently aborted) when the test iframe is transferred between pages (and
+// the original page closes). This causes the final navigation to not complete
+// and test terminated due to a timeout.
+
+// Currently disabled (http://crbug.com/55200, work in progress).
+IN_PROC_BROWSER_TEST_F(MagicIframeBrowserTest,
+ DISABLED_TransferIframeCloseWindow) {
+ ASSERT_TRUE(test_server()->Start());
+ GURL url(GetTestURL("iframe-reparenting-close-window.html"));
+ ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(browser(), url, 3);
+ std::string result;
+ ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
+ browser()->GetSelectedTabContents()->render_view_host(), L"",
+ L"window.domAutomationController.send(getLog())", &result));
+ ASSERT_NE(result.find("DONE"), std::string::npos) << result;
+}
+
« no previous file with comments | « no previous file | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698