| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/string_util.h" | 5 #include "base/string_util.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/test/in_process_browser_test.h" | 8 #include "chrome/test/in_process_browser_test.h" |
| 9 #include "chrome/test/ui_test_utils.h" | 9 #include "chrome/test/ui_test_utils.h" |
| 10 #include "content/browser/tab_contents/tab_contents.h" | 10 #include "content/browser/tab_contents/tab_contents.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 Browser* popup = ui_test_utils::GetBrowserNotInSet(excluded); | 45 Browser* popup = ui_test_utils::GetBrowserNotInSet(excluded); |
| 46 if (!popup) | 46 if (!popup) |
| 47 return false; | 47 return false; |
| 48 | 48 |
| 49 *title = popup->GetWindowTitleForCurrentTab(); | 49 *title = popup->GetWindowTitleForCurrentTab(); |
| 50 return true; | 50 return true; |
| 51 } | 51 } |
| 52 | 52 |
| 53 // Test title for content created by javascript window.open(). | 53 // Test title for content created by javascript window.open(). |
| 54 // See http://crbug.com/5988 | 54 // See http://crbug.com/5988 |
| 55 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DynamicTitle1) { | 55 // Disabled for http://code.google.com/p/chromium/issues/detail?id=86346 |
| 56 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
| 57 DISABLED_DynamicTitle1) { |
| 56 ASSERT_TRUE(test_server()->Start()); | 58 ASSERT_TRUE(test_server()->Start()); |
| 57 | 59 |
| 58 GURL url(test_server()->GetURL("files/dynamic1.html")); | 60 GURL url(test_server()->GetURL("files/dynamic1.html")); |
| 59 string16 title; | 61 string16 title; |
| 60 ASSERT_TRUE(GetPopupTitle(url, &title)); | 62 ASSERT_TRUE(GetPopupTitle(url, &title)); |
| 61 EXPECT_TRUE(StartsWith(title, ASCIIToUTF16("My Popup Title"), true)) | 63 EXPECT_TRUE(StartsWith(title, ASCIIToUTF16("My Popup Title"), true)) |
| 62 << "Actual title: " << title; | 64 << "Actual title: " << title; |
| 63 } | 65 } |
| 64 | 66 |
| 65 // Test title for content created by javascript window.open(). | 67 // Test title for content created by javascript window.open(). |
| 66 // See http://crbug.com/5988 | 68 // See http://crbug.com/5988 |
| 67 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DynamicTitle2) { | 69 // Disabled for http://code.google.com/p/chromium/issues/detail?id=86346 |
| 70 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, |
| 71 DISABLED_DynamicTitle2) { |
| 68 ASSERT_TRUE(test_server()->Start()); | 72 ASSERT_TRUE(test_server()->Start()); |
| 69 | 73 |
| 70 GURL url(test_server()->GetURL("files/dynamic2.html")); | 74 GURL url(test_server()->GetURL("files/dynamic2.html")); |
| 71 string16 title; | 75 string16 title; |
| 72 ASSERT_TRUE(GetPopupTitle(url, &title)); | 76 ASSERT_TRUE(GetPopupTitle(url, &title)); |
| 73 EXPECT_TRUE(StartsWith(title, ASCIIToUTF16("My Dynamic Title"), true)) | 77 EXPECT_TRUE(StartsWith(title, ASCIIToUTF16("My Dynamic Title"), true)) |
| 74 << "Actual title: " << title; | 78 << "Actual title: " << title; |
| 75 } | 79 } |
| OLD | NEW |