| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 // dimension 640x480), resize it to 100x200, and then we set the source to a | 357 // dimension 640x480), resize it to 100x200, and then we set the source to a |
| 358 // sample guest. In the end we verify that the correct size has been set. | 358 // sample guest. In the end we verify that the correct size has been set. |
| 359 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, NavigateAfterResize) { | 359 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, NavigateAfterResize) { |
| 360 const gfx::Size nxt_size = gfx::Size(100, 200); | 360 const gfx::Size nxt_size = gfx::Size(100, 200); |
| 361 const std::string embedder_code = base::StringPrintf( | 361 const std::string embedder_code = base::StringPrintf( |
| 362 "SetSize(%d, %d);", nxt_size.width(), nxt_size.height()); | 362 "SetSize(%d, %d);", nxt_size.width(), nxt_size.height()); |
| 363 const char kEmbedderURL[] = "/browser_plugin_embedder.html"; | 363 const char kEmbedderURL[] = "/browser_plugin_embedder.html"; |
| 364 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, embedder_code); | 364 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, embedder_code); |
| 365 | 365 |
| 366 // Wait for the guest to be resized to 100x200. | 366 // Wait for the guest to be resized to 100x200. |
| 367 test_guest()->WaitForViewSize(nxt_size); | 367 test_guest()->WaitForResizeGuest(nxt_size); |
| 368 | |
| 369 // TODO(lazyboy): Instead do the following once it's not flaky. | |
| 370 // Wait for the guest to receive a damage buffer of size 100x200. | |
| 371 // This means the guest will be painted properly at that size. | |
| 372 // test_guest()->WaitForDamageBufferWithSize(nxt_size); | |
| 373 } | 368 } |
| 374 | 369 |
| 375 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AdvanceFocus) { | 370 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AdvanceFocus) { |
| 376 const char kEmbedderURL[] = "/browser_plugin_focus.html"; | 371 const char kEmbedderURL[] = "/browser_plugin_focus.html"; |
| 377 const char* kGuestURL = "/browser_plugin_focus_child.html"; | 372 const char* kGuestURL = "/browser_plugin_focus_child.html"; |
| 378 StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string()); | 373 StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string()); |
| 379 | 374 |
| 380 SimulateMouseClick(test_embedder()->web_contents(), 0, | 375 SimulateMouseClick(test_embedder()->web_contents(), 0, |
| 381 blink::WebMouseEvent::ButtonLeft); | 376 blink::WebMouseEvent::ButtonLeft); |
| 382 BrowserPluginHostTest::SimulateTabKeyPress(test_embedder()->web_contents()); | 377 BrowserPluginHostTest::SimulateTabKeyPress(test_embedder()->web_contents()); |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 scoped_ptr<base::Value> value = | 1056 scoped_ptr<base::Value> value = |
| 1062 content::ExecuteScriptAndGetValue( | 1057 content::ExecuteScriptAndGetValue( |
| 1063 guest_rfh, "document.getElementById('input1').value"); | 1058 guest_rfh, "document.getElementById('input1').value"); |
| 1064 std::string actual_value; | 1059 std::string actual_value; |
| 1065 ASSERT_TRUE(value->GetAsString(&actual_value)); | 1060 ASSERT_TRUE(value->GetAsString(&actual_value)); |
| 1066 EXPECT_EQ(base::UTF16ToUTF8(expected_value), actual_value); | 1061 EXPECT_EQ(base::UTF16ToUTF8(expected_value), actual_value); |
| 1067 } | 1062 } |
| 1068 } | 1063 } |
| 1069 | 1064 |
| 1070 } // namespace content | 1065 } // namespace content |
| OLD | NEW |