OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 FrameTestHelpers::LoadFrame(web_view_helper_.WebView()->MainFrameImpl(), | 174 FrameTestHelpers::LoadFrame(web_view_helper_.WebView()->MainFrameImpl(), |
175 std::string(base_url) + file_name); | 175 std::string(base_url) + file_name); |
176 } | 176 } |
177 | 177 |
178 void NavigateAway() { | 178 void NavigateAway() { |
179 FrameTestHelpers::LoadFrame(web_view_helper_.WebView()->MainFrameImpl(), | 179 FrameTestHelpers::LoadFrame(web_view_helper_.WebView()->MainFrameImpl(), |
180 "about:blank"); | 180 "about:blank"); |
181 } | 181 } |
182 | 182 |
183 void Close() { | 183 void Close() { |
184 web_view_helper_.WebView()->MainFrameImpl()->CollectGarbage(); | 184 web_view_helper_.LocalMainFrame()->CollectGarbage(); |
185 web_view_helper_.Reset(); | 185 web_view_helper_.Reset(); |
186 | 186 |
187 WebCache::Clear(); | 187 WebCache::Clear(); |
188 } | 188 } |
189 | 189 |
190 Element& Console() { | 190 Element& Console() { |
191 Document* document = | 191 Document* document = |
192 web_view_helper_.WebView()->MainFrameImpl()->GetFrame()->GetDocument(); | 192 web_view_helper_.LocalMainFrame()->GetFrame()->GetDocument(); |
193 Element* console = document->getElementById("console"); | 193 Element* console = document->getElementById("console"); |
194 DCHECK(isHTMLUListElement(console)); | 194 DCHECK(isHTMLUListElement(console)); |
195 return *console; | 195 return *console; |
196 } | 196 } |
197 | 197 |
198 unsigned ConsoleLength() { return Console().CountChildren() - 1; } | 198 unsigned ConsoleLength() { return Console().CountChildren() - 1; } |
199 | 199 |
200 WebString ConsoleAt(unsigned i) { | 200 WebString ConsoleAt(unsigned i) { |
201 DCHECK_GT(ConsoleLength(), i); | 201 DCHECK_GT(ConsoleLength(), i); |
202 | 202 |
203 Node* item = NodeTraversal::ChildAt(Console(), 1 + i); | 203 Node* item = NodeTraversal::ChildAt(Console(), 1 + i); |
204 | 204 |
205 DCHECK(item); | 205 DCHECK(item); |
206 DCHECK(isHTMLLIElement(item)); | 206 DCHECK(isHTMLLIElement(item)); |
207 DCHECK(item->hasChildren()); | 207 DCHECK(item->hasChildren()); |
208 | 208 |
209 return item->textContent(); | 209 return item->textContent(); |
210 } | 210 } |
211 | 211 |
212 void ExecuteScript(const char* code) { | 212 void ExecuteScript(const char* code) { |
213 web_view_helper_.WebView()->MainFrameImpl()->ExecuteScript( | 213 web_view_helper_.LocalMainFrame()->ExecuteScript( |
214 WebScriptSource(WebString::FromUTF8(code))); | 214 WebScriptSource(WebString::FromUTF8(code))); |
215 } | 215 } |
216 | 216 |
217 TestPrerenderingSupport* PrerenderingSupport() { | 217 TestPrerenderingSupport* PrerenderingSupport() { |
218 return &prerendering_support_; | 218 return &prerendering_support_; |
219 } | 219 } |
220 | 220 |
221 TestPrerendererClient* PrerendererClient() { return &prerenderer_client_; } | 221 TestPrerendererClient* PrerendererClient() { return &prerenderer_client_; } |
222 | 222 |
223 private: | 223 private: |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 WebPrerender rel_next_and_prerender = | 468 WebPrerender rel_next_and_prerender = |
469 PrerendererClient()->ReleaseWebPrerender(); | 469 PrerendererClient()->ReleaseWebPrerender(); |
470 EXPECT_EQ(ToWebURL("http://rel-next-and-prerender.com/"), | 470 EXPECT_EQ(ToWebURL("http://rel-next-and-prerender.com/"), |
471 rel_next_and_prerender.Url()); | 471 rel_next_and_prerender.Url()); |
472 EXPECT_EQ( | 472 EXPECT_EQ( |
473 static_cast<unsigned>(kPrerenderRelTypeNext | kPrerenderRelTypePrerender), | 473 static_cast<unsigned>(kPrerenderRelTypeNext | kPrerenderRelTypePrerender), |
474 rel_next_and_prerender.RelTypes()); | 474 rel_next_and_prerender.RelTypes()); |
475 } | 475 } |
476 | 476 |
477 } // namespace blink | 477 } // namespace blink |
OLD | NEW |