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

Side by Side 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: Actually disable the test 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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/command_line.h"
6 #include "base/file_path.h"
7 #include "base/file_util.h"
8 #include "base/memory/ref_counted.h"
9 #include "base/scoped_temp_dir.h"
10 #include "base/test/thread_test_helper.h"
11 #include "base/utf_string_conversions.h"
12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/test/base/in_process_browser_test.h"
14 #include "chrome/test/base/ui_test_utils.h"
15 #include "chrome/test/testing_profile.h"
16 #include "content/browser/tab_contents/tab_contents.h"
17 #include "content/common/content_switches.h"
18
19 class MagicIframeBrowserTest : public InProcessBrowserTest {
20 public:
21 MagicIframeBrowserTest() {
22 EnableDOMAutomation();
23 }
24
25 GURL GetTestURL(const char* path) {
Paweł Hajdan Jr. 2011/08/03 16:27:27 nit: Why not just const std::string& ? Or StringPi
26 std::string url_path = "files/magic_iframe/";
Paweł Hajdan Jr. 2011/08/03 16:27:27 This seems to be assuming things about current wor
27 url_path.append(path);
28 return test_server()->GetURL(url_path);
29 }
30 private:
31 DISALLOW_COPY_AND_ASSIGN(MagicIframeBrowserTest);
Paweł Hajdan Jr. 2011/08/03 16:27:27 nit: No need for DISALLOW_... for test fixtures. P
32 };
33
34 // This browser test is verifying that reparenting of iframe between different
35 // pages works as expected, including smooth transfer of resources that are
36 // still being loaded.
37
38 // Currently broken. See http://crbug.com/55200
39 #define MAYBE_TransferIframeCloseWindow DISABLED_TransferIframeCloseWindow
Paweł Hajdan Jr. 2011/08/03 16:27:27 nit: No MAYBE here, just DISABLED below. Also, I'
40
41 IN_PROC_BROWSER_TEST_F(MagicIframeBrowserTest,
42 MAYBE_TransferIframeCloseWindow) {
43 ASSERT_TRUE(test_server()->Start());
44 GURL url(GetTestURL("iframe-reparenting-close-window.html"));
45 LOG(INFO) << "INFO: \n"
Paweł Hajdan Jr. 2011/08/03 16:27:27 Don't spam the output please. It will not hang bec
46 << "If this test does not print some log information and then 'DONE',\n"
47 << " for example if it hangs forever right after this point or crashes\n"
48 << " test server - that means the crbug 55200 has regressed.";
49 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(browser(), url, 3);
50 std::string result;
51 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
52 browser()->GetSelectedTabContents()->render_view_host(), L"",
53 L"window.domAutomationController.send(getLog())", &result));
54 LOG(INFO) << "\nLog: " << result;
Paweł Hajdan Jr. 2011/08/03 16:27:27 Do we always need to print the log or can we do th
55 ASSERT_NE(result.find("DONE"), std::string::npos);
56 }
57
Paweł Hajdan Jr. 2011/08/03 16:27:27 nit: redundant empty line?
58
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome_tests.gypi » ('j') | chrome/test/data/magic_iframe/iframe-reparenting-close-window.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698