| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 TestWebFrameClient m_webFrameClient; | 109 TestWebFrameClient m_webFrameClient; |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 TEST_F(WebPageSerializerTest, HTMLNodes) | 112 TEST_F(WebPageSerializerTest, HTMLNodes) |
| 113 { | 113 { |
| 114 // Register the mocked frame and load it. | 114 // Register the mocked frame and load it. |
| 115 WebURL topFrameURL = toKURL("http://www.test.com"); | 115 WebURL topFrameURL = toKURL("http://www.test.com"); |
| 116 registerMockedURLLoad("http://www.test.com", WebString::fromUTF8("simple_pag
e.html")); | 116 registerMockedURLLoad("http://www.test.com", WebString::fromUTF8("simple_pag
e.html")); |
| 117 registerMockedURLLoad("http://www.example.com/beautifull.css", WebString::fr
omUTF8("beautifull.css")); |
| 117 loadURLInTopFrame(topFrameURL); | 118 loadURLInTopFrame(topFrameURL); |
| 118 | 119 |
| 119 // Retrieve all resources. | 120 // Retrieve all resources. |
| 120 WebVector<WebURL> frames; | 121 WebVector<WebURL> frames; |
| 121 WebVector<WebURL> resources; | 122 WebVector<WebURL> resources; |
| 122 ASSERT_TRUE(WebPageSerializer::retrieveAllResources( | 123 ASSERT_TRUE(WebPageSerializer::retrieveAllResources( |
| 123 m_webView, m_supportedSchemes, &resources, &frames)); | 124 m_webView, m_supportedSchemes, &resources, &frames)); |
| 124 | 125 |
| 125 // Tests that all resources from the frame have been retrieved. | 126 // Tests that all resources from the frame have been retrieved. |
| 126 EXPECT_EQ(1U, frames.size()); // There should be no duplicates. | 127 EXPECT_EQ(1U, frames.size()); // There should be no duplicates. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/innerFrame.png
")); | 181 EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/innerFrame.png
")); |
| 181 EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/flash.swf")); | 182 EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/flash.swf")); |
| 182 // FIXME: for some reason the following resources is missing on one of the b
ot | 183 // FIXME: for some reason the following resources is missing on one of the b
ot |
| 183 // causing the test to fail. Probably a plugin issue. | 184 // causing the test to fail. Probably a plugin issue. |
| 184 // EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/music.mid")
); | 185 // EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/music.mid")
); |
| 185 EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/object.png")); | 186 EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/object.png")); |
| 186 EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/embed.png")); | 187 EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/embed.png")); |
| 187 } | 188 } |
| 188 | 189 |
| 189 } | 190 } |
| OLD | NEW |