| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 virtual void SetUp() OVERRIDE { | 220 virtual void SetUp() OVERRIDE { |
| 221 // Override factory to create tests instances of BrowserPlugin*. | 221 // Override factory to create tests instances of BrowserPlugin*. |
| 222 content::BrowserPluginEmbedder::set_factory_for_testing( | 222 content::BrowserPluginEmbedder::set_factory_for_testing( |
| 223 TestBrowserPluginHostFactory::GetInstance()); | 223 TestBrowserPluginHostFactory::GetInstance()); |
| 224 content::BrowserPluginGuest::set_factory_for_testing( | 224 content::BrowserPluginGuest::set_factory_for_testing( |
| 225 TestBrowserPluginHostFactory::GetInstance()); | 225 TestBrowserPluginHostFactory::GetInstance()); |
| 226 content::BrowserPluginGuestManager::set_factory_for_testing( | 226 content::BrowserPluginGuestManager::set_factory_for_testing( |
| 227 TestBrowserPluginHostFactory::GetInstance()); | 227 TestBrowserPluginHostFactory::GetInstance()); |
| 228 | 228 |
| 229 // On legacy windows, the AcceptDragEvents test needs this to pass. | |
| 230 #if defined(OS_WIN) && !defined(USE_AURA) | |
| 231 UseRealGLBindings(); | |
| 232 #endif | |
| 233 // We need real contexts, otherwise the embedder doesn't composite, but the | 229 // We need real contexts, otherwise the embedder doesn't composite, but the |
| 234 // guest does, and that isn't an expected configuration. | 230 // guest does, and that isn't an expected configuration. |
| 235 UseRealGLContexts(); | 231 UseRealGLContexts(); |
| 236 | 232 |
| 237 ContentBrowserTest::SetUp(); | 233 ContentBrowserTest::SetUp(); |
| 238 } | 234 } |
| 239 virtual void TearDown() OVERRIDE { | 235 virtual void TearDown() OVERRIDE { |
| 240 content::BrowserPluginEmbedder::set_factory_for_testing(NULL); | 236 content::BrowserPluginEmbedder::set_factory_for_testing(NULL); |
| 241 content::BrowserPluginGuest::set_factory_for_testing(NULL); | 237 content::BrowserPluginGuest::set_factory_for_testing(NULL); |
| 242 | 238 |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 TestBrowserPluginGuest* new_test_guest = | 568 TestBrowserPluginGuest* new_test_guest = |
| 573 static_cast<TestBrowserPluginGuest*>( | 569 static_cast<TestBrowserPluginGuest*>( |
| 574 test_guest_web_contents->GetBrowserPluginGuest()); | 570 test_guest_web_contents->GetBrowserPluginGuest()); |
| 575 ASSERT_TRUE(new_test_guest != NULL); | 571 ASSERT_TRUE(new_test_guest != NULL); |
| 576 | 572 |
| 577 // Wait for the guest to send an UpdateRectMsg, meaning it is ready. | 573 // Wait for the guest to send an UpdateRectMsg, meaning it is ready. |
| 578 new_test_guest->WaitForUpdateRectMsg(); | 574 new_test_guest->WaitForUpdateRectMsg(); |
| 579 } | 575 } |
| 580 } | 576 } |
| 581 | 577 |
| 582 // Always failing in the win7_aura try bot. See http://crbug.com/181107. | 578 // Always failing in the win7 try bot. See http://crbug.com/181107. |
| 583 // Times out on the Mac. See http://crbug.com/297576. | 579 // Times out on the Mac. See http://crbug.com/297576. |
| 584 #if (defined(OS_WIN) && defined(USE_AURA)) || defined(OS_MACOSX) | 580 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 585 #define MAYBE_AcceptDragEvents DISABLED_AcceptDragEvents | 581 #define MAYBE_AcceptDragEvents DISABLED_AcceptDragEvents |
| 586 #else | 582 #else |
| 587 #define MAYBE_AcceptDragEvents AcceptDragEvents | 583 #define MAYBE_AcceptDragEvents AcceptDragEvents |
| 588 #endif | 584 #endif |
| 589 | 585 |
| 590 // Tests that a drag-n-drop over the browser plugin in the embedder happens | 586 // Tests that a drag-n-drop over the browser plugin in the embedder happens |
| 591 // correctly. | 587 // correctly. |
| 592 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, MAYBE_AcceptDragEvents) { | 588 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, MAYBE_AcceptDragEvents) { |
| 593 const char kEmbedderURL[] = "/browser_plugin_dragging.html"; | 589 const char kEmbedderURL[] = "/browser_plugin_dragging.html"; |
| 594 StartBrowserPluginTest( | 590 StartBrowserPluginTest( |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1031 scoped_ptr<base::Value> value = | 1027 scoped_ptr<base::Value> value = |
| 1032 content::ExecuteScriptAndGetValue( | 1028 content::ExecuteScriptAndGetValue( |
| 1033 guest_rvh, "document.getElementById('input1').value"); | 1029 guest_rvh, "document.getElementById('input1').value"); |
| 1034 std::string actual_value; | 1030 std::string actual_value; |
| 1035 ASSERT_TRUE(value->GetAsString(&actual_value)); | 1031 ASSERT_TRUE(value->GetAsString(&actual_value)); |
| 1036 EXPECT_EQ(base::UTF16ToUTF8(expected_value), actual_value); | 1032 EXPECT_EQ(base::UTF16ToUTF8(expected_value), actual_value); |
| 1037 } | 1033 } |
| 1038 } | 1034 } |
| 1039 | 1035 |
| 1040 } // namespace content | 1036 } // namespace content |
| OLD | NEW |