OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 } | 165 } |
166 MHTMLArchive::GenerateMHTMLFooterForTesting(boundary, | 166 MHTMLArchive::GenerateMHTMLFooterForTesting(boundary, |
167 *mhtml_data->MutableData()); | 167 *mhtml_data->MutableData()); |
168 | 168 |
169 // Validate the generated MHTML. | 169 // Validate the generated MHTML. |
170 MHTMLParser parser( | 170 MHTMLParser parser( |
171 SharedBuffer::Create(mhtml_data->data(), mhtml_data->length())); | 171 SharedBuffer::Create(mhtml_data->data(), mhtml_data->length())); |
172 EXPECT_FALSE(parser.ParseArchive().IsEmpty()) | 172 EXPECT_FALSE(parser.ParseArchive().IsEmpty()) |
173 << "Generated MHTML is malformed"; | 173 << "Generated MHTML is malformed"; |
174 | 174 |
175 return mhtml_data.Release(); | 175 return mhtml_data; |
176 } | 176 } |
177 | 177 |
178 PassRefPtr<RawData> Serialize(const char* title, | 178 PassRefPtr<RawData> Serialize(const char* title, |
179 const char* mime, | 179 const char* mime, |
180 MHTMLArchive::EncodingPolicy encoding_policy) { | 180 MHTMLArchive::EncodingPolicy encoding_policy) { |
181 return GenerateMHTMLData(resources_, encoding_policy, title, mime); | 181 return GenerateMHTMLData(resources_, encoding_policy, title, mime); |
182 } | 182 } |
183 | 183 |
184 private: | 184 private: |
185 PassRefPtr<SharedBuffer> ReadFile(const char* file_name) { | 185 PassRefPtr<SharedBuffer> ReadFile(const char* file_name) { |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 .getElementById("s1")); | 331 .getElementById("s1")); |
332 // The element to be created by the script in the shadow dom template is | 332 // The element to be created by the script in the shadow dom template is |
333 // not found because the script is blocked. | 333 // not found because the script is blocked. |
334 EXPECT_FALSE(document->getElementById("h4") | 334 EXPECT_FALSE(document->getElementById("h4") |
335 ->Shadow() | 335 ->Shadow() |
336 ->OldestShadowRoot() | 336 ->OldestShadowRoot() |
337 .getElementById("s2")); | 337 .getElementById("s2")); |
338 } | 338 } |
339 | 339 |
340 } // namespace blink | 340 } // namespace blink |
OLD | NEW |