| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 private: | 148 private: |
| 149 class WebPrerenderEqual : public std::binary_function<WebPrerender, WebPrere
nder, bool> { | 149 class WebPrerenderEqual : public std::binary_function<WebPrerender, WebPrere
nder, bool> { |
| 150 public: | 150 public: |
| 151 bool operator()(const WebPrerender& first, const WebPrerender& second) c
onst | 151 bool operator()(const WebPrerender& first, const WebPrerender& second) c
onst |
| 152 { | 152 { |
| 153 return first.toPrerender() == second.toPrerender(); | 153 return first.toPrerender() == second.toPrerender(); |
| 154 } | 154 } |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 // From WebPrerenderingSupport: | 157 // From WebPrerenderingSupport: |
| 158 virtual void preconnect(const WebURL& url, WebPreconnectMotivation motivatio
n) OVERRIDE |
| 159 { |
| 160 } |
| 161 |
| 158 virtual void add(const WebPrerender& prerender) OVERRIDE | 162 virtual void add(const WebPrerender& prerender) OVERRIDE |
| 159 { | 163 { |
| 160 m_addedPrerenders.push_back(prerender); | 164 m_addedPrerenders.push_back(prerender); |
| 161 } | 165 } |
| 162 | 166 |
| 163 virtual void cancel(const WebPrerender& prerender) OVERRIDE | 167 virtual void cancel(const WebPrerender& prerender) OVERRIDE |
| 164 { | 168 { |
| 165 m_canceledPrerenders.push_back(prerender); | 169 m_canceledPrerenders.push_back(prerender); |
| 166 } | 170 } |
| 167 | 171 |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 EXPECT_EQ(0u, prerenderingSupport()->cancelCount(webPrerender)); | 496 EXPECT_EQ(0u, prerenderingSupport()->cancelCount(webPrerender)); |
| 493 EXPECT_EQ(1u, prerenderingSupport()->totalCount()); | 497 EXPECT_EQ(1u, prerenderingSupport()->totalCount()); |
| 494 | 498 |
| 495 // Change the rel of this prerender, make sure this is treated as a remove. | 499 // Change the rel of this prerender, make sure this is treated as a remove. |
| 496 executeScript("mutateRel()"); | 500 executeScript("mutateRel()"); |
| 497 EXPECT_EQ(1u, prerenderingSupport()->cancelCount(webPrerender)); | 501 EXPECT_EQ(1u, prerenderingSupport()->cancelCount(webPrerender)); |
| 498 EXPECT_EQ(2u, prerenderingSupport()->totalCount()); | 502 EXPECT_EQ(2u, prerenderingSupport()->totalCount()); |
| 499 } | 503 } |
| 500 | 504 |
| 501 } // namespace | 505 } // namespace |
| OLD | NEW |