| 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/test/automation/tab_proxy.h" | 8 #include "chrome/test/automation/tab_proxy.h" |
| 9 #include "chrome/test/ui/ui_test.h" | 9 #include "chrome/test/ui/ui_test.h" |
| 10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
| 11 | 11 |
| 12 class DefaultPluginUITest : public UITest { | 12 class DefaultPluginUITest : public UITest { |
| 13 public: | 13 public: |
| 14 DefaultPluginUITest() { | 14 DefaultPluginUITest() { |
| 15 dom_automation_enabled_ = true; | 15 dom_automation_enabled_ = true; |
| 16 } | 16 } |
| 17 }; | 17 }; |
| 18 | 18 |
| 19 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
| 20 #define MAYBE_DefaultPluginLoadTest DISABLED_DefaultPluginLoadTest | 20 #define MAYBE_DefaultPluginLoadTest DefaultPluginLoadTest |
| 21 #else | 21 #else |
| 22 #define MAYBE_DefaultPluginLoadTest DefaultPluginLoadTest | 22 #define MAYBE_DefaultPluginLoadTest DefaultPluginLoadTest |
| 23 #endif | 23 #endif |
| 24 TEST_F(DefaultPluginUITest, MAYBE_DefaultPluginLoadTest) { | 24 TEST_F(DefaultPluginUITest, MAYBE_DefaultPluginLoadTest) { |
| 25 // Open page with default plugin. | 25 // Open page with default plugin. |
| 26 FilePath test_file(test_data_directory_); | 26 FilePath test_file(test_data_directory_); |
| 27 test_file = test_file.AppendASCII("default_plugin.html"); | 27 test_file = test_file.AppendASCII("default_plugin.html"); |
| 28 NavigateToURL(net::FilePathToFileURL(test_file)); | 28 NavigateToURL(net::FilePathToFileURL(test_file)); |
| 29 | 29 |
| 30 // Check that the default plugin was loaded. It executes a bit of javascript | 30 // Check that the default plugin was loaded. It executes a bit of javascript |
| 31 // in the HTML file which replaces the innerHTML of div |result| with "DONE". | 31 // in the HTML file which replaces the innerHTML of div |result| with "DONE". |
| 32 scoped_refptr<TabProxy> tab(GetActiveTab()); | 32 scoped_refptr<TabProxy> tab(GetActiveTab()); |
| 33 std::wstring out; | 33 std::wstring out; |
| 34 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", | 34 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", |
| 35 L"domAutomationController.send(" | 35 L"domAutomationController.send(" |
| 36 L"document.getElementById('result').innerHTML)", &out)); | 36 L"document.getElementById('result').innerHTML)", &out)); |
| 37 ASSERT_EQ(L"DONE", out); | 37 ASSERT_EQ(L"DONE", out); |
| 38 } | 38 } |
| OLD | NEW |