OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/singleton.h" | 6 #include "base/memory/singleton.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 10 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 test_embedder()->web_contents()->GetRenderViewHost()); | 811 test_embedder()->web_contents()->GetRenderViewHost()); |
812 GURL test_url = test_server()->GetURL("close-socket"); | 812 GURL test_url = test_server()->GetURL("close-socket"); |
813 ExecuteSyncJSFunction( | 813 ExecuteSyncJSFunction( |
814 rvh, StringPrintf("SetSrc('%s');", test_url.spec().c_str())); | 814 rvh, StringPrintf("SetSrc('%s');", test_url.spec().c_str())); |
815 string16 actual_title = title_watcher.WaitAndGetTitle(); | 815 string16 actual_title = title_watcher.WaitAndGetTitle(); |
816 EXPECT_EQ(expected_title, actual_title); | 816 EXPECT_EQ(expected_title, actual_title); |
817 } | 817 } |
818 | 818 |
819 { | 819 { |
820 // Navigate the guest to an illegal chrome:// URL. | 820 // Navigate the guest to an illegal chrome:// URL. |
821 const string16 expected_title = ASCIIToUTF16("ERR_FAILED"); | 821 const string16 expected_title = ASCIIToUTF16("ERR_INVALID_URL"); |
822 content::TitleWatcher title_watcher(test_embedder()->web_contents(), | 822 content::TitleWatcher title_watcher(test_embedder()->web_contents(), |
823 expected_title); | 823 expected_title); |
824 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( | 824 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( |
825 test_embedder()->web_contents()->GetRenderViewHost()); | 825 test_embedder()->web_contents()->GetRenderViewHost()); |
826 GURL test_url("chrome://newtab"); | 826 GURL test_url("chrome://newtab"); |
827 ExecuteSyncJSFunction( | 827 ExecuteSyncJSFunction( |
828 rvh, StringPrintf("SetSrc('%s');", test_url.spec().c_str())); | 828 rvh, StringPrintf("SetSrc('%s');", test_url.spec().c_str())); |
829 string16 actual_title = title_watcher.WaitAndGetTitle(); | 829 string16 actual_title = title_watcher.WaitAndGetTitle(); |
830 EXPECT_EQ(expected_title, actual_title); | 830 EXPECT_EQ(expected_title, actual_title); |
831 } | 831 } |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 expected_title); | 1276 expected_title); |
1277 ExecuteSyncJSFunction(rvh, | 1277 ExecuteSyncJSFunction(rvh, |
1278 "document.getElementById('plugin').name = 'foobar';"); | 1278 "document.getElementById('plugin').name = 'foobar';"); |
1279 string16 actual_title = title_watcher.WaitAndGetTitle(); | 1279 string16 actual_title = title_watcher.WaitAndGetTitle(); |
1280 EXPECT_EQ(expected_title, actual_title); | 1280 EXPECT_EQ(expected_title, actual_title); |
1281 | 1281 |
1282 } | 1282 } |
1283 } | 1283 } |
1284 | 1284 |
1285 } // namespace content | 1285 } // namespace content |
OLD | NEW |