| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 CopyTestPlugin(); | 89 CopyTestPlugin(); |
| 90 | 90 |
| 91 test_shell_->webView()->GetMainFrame()->ExecuteScript(refresh); | 91 test_shell_->webView()->GetMainFrame()->ExecuteScript(refresh); |
| 92 test_shell_->webView()->GetMainFrame()->ExecuteScript(call_check); | 92 test_shell_->webView()->GetMainFrame()->ExecuteScript(call_check); |
| 93 test_shell_->webView()->GetMainFrame()->GetContentAsPlainText(10000, &text); | 93 test_shell_->webView()->GetMainFrame()->GetContentAsPlainText(10000, &text); |
| 94 ASSERT_EQ(text, L"DONE"); | 94 ASSERT_EQ(text, L"DONE"); |
| 95 | 95 |
| 96 DeleteTestPlugin(); | 96 DeleteTestPlugin(); |
| 97 } | 97 } |
| 98 |
| 99 TEST_F(PluginTest, DefaultPluginLoadTest) { |
| 100 std::string html = "\ |
| 101 <div id='result'>Test running....</div>\ |
| 102 <script>\ |
| 103 function onSuccess() {\ |
| 104 var result = document.getElementById('result');\ |
| 105 result.innerHTML = 'DONE';\ |
| 106 }\ |
| 107 </script>\ |
| 108 <DIV ID=PluginDiv>\ |
| 109 <object classid=\"clsid:9E8BC6CE-AF35-400c-ABF6-A3F746A1871D\">\ |
| 110 <embed type=\"application/chromium-test-default-plugin\"\ |
| 111 mode=\"np_embed\"\ |
| 112 ></embed>\ |
| 113 </object>\ |
| 114 </DIV>\ |
| 115 "; |
| 116 |
| 117 test_shell_->webView()->GetMainFrame()->LoadHTMLString( |
| 118 html, GURL("about:blank")); |
| 119 test_shell_->WaitTestFinished(); |
| 120 |
| 121 std::wstring text; |
| 122 test_shell_->webView()->GetMainFrame()->GetContentAsPlainText(10000, &text); |
| 123 |
| 124 ASSERT_EQ(true, StartsWith(text, L"DONE", true)); |
| 125 } |
| OLD | NEW |