| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 Vector<WebPrerender> m_addedPrerenders; | 154 Vector<WebPrerender> m_addedPrerenders; |
| 155 Vector<WebPrerender> m_canceledPrerenders; | 155 Vector<WebPrerender> m_canceledPrerenders; |
| 156 Vector<WebPrerender> m_abandonedPrerenders; | 156 Vector<WebPrerender> m_abandonedPrerenders; |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 class PrerenderingTest : public ::testing::Test { | 159 class PrerenderingTest : public ::testing::Test { |
| 160 public: | 160 public: |
| 161 ~PrerenderingTest() override { | 161 ~PrerenderingTest() override { |
| 162 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); | 162 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); |
| 163 WebCache::clear(); | |
| 164 } | 163 } |
| 165 | 164 |
| 166 void initialize(const char* baseURL, const char* fileName) { | 165 void initialize(const char* baseURL, const char* fileName) { |
| 167 URLTestHelpers::registerMockedURLLoadFromBase( | 166 URLTestHelpers::registerMockedURLLoadFromBase( |
| 168 WebString::fromUTF8(baseURL), blink::testing::webTestDataPath(), | 167 WebString::fromUTF8(baseURL), blink::testing::webTestDataPath(), |
| 169 WebString::fromUTF8(fileName)); | 168 WebString::fromUTF8(fileName)); |
| 170 const bool RunJavascript = true; | 169 const bool RunJavascript = true; |
| 171 m_webViewHelper.initialize(RunJavascript); | 170 m_webViewHelper.initialize(RunJavascript); |
| 172 m_webViewHelper.webView()->setPrerendererClient(&m_prerendererClient); | 171 m_webViewHelper.webView()->setPrerendererClient(&m_prerendererClient); |
| 173 | 172 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 466 |
| 468 WebPrerender relNextAndPrerender = prerendererClient()->releaseWebPrerender(); | 467 WebPrerender relNextAndPrerender = prerendererClient()->releaseWebPrerender(); |
| 469 EXPECT_EQ(toWebURL("http://rel-next-and-prerender.com/"), | 468 EXPECT_EQ(toWebURL("http://rel-next-and-prerender.com/"), |
| 470 relNextAndPrerender.url()); | 469 relNextAndPrerender.url()); |
| 471 EXPECT_EQ( | 470 EXPECT_EQ( |
| 472 static_cast<unsigned>(PrerenderRelTypeNext | PrerenderRelTypePrerender), | 471 static_cast<unsigned>(PrerenderRelTypeNext | PrerenderRelTypePrerender), |
| 473 relNextAndPrerender.relTypes()); | 472 relNextAndPrerender.relTypes()); |
| 474 } | 473 } |
| 475 | 474 |
| 476 } // namespace blink | 475 } // namespace blink |
| OLD | NEW |