Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: webkit/tools/test_shell/plugin_tests.cc

Issue 72004: Relanding the following revisions.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webframeloaderclient_impl.cc ('k') | webkit/tools/test_shell/test_shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « webkit/glue/webframeloaderclient_impl.cc ('k') | webkit/tools/test_shell/test_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698