| 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 30 matching lines...) Expand all Loading... |
| 41 #include "public/web/WebPageSerializer.h" | 41 #include "public/web/WebPageSerializer.h" |
| 42 #include "public/web/WebPageSerializerClient.h" | 42 #include "public/web/WebPageSerializerClient.h" |
| 43 #include "public/web/WebScriptSource.h" | 43 #include "public/web/WebScriptSource.h" |
| 44 #include "public/web/WebSettings.h" | 44 #include "public/web/WebSettings.h" |
| 45 #include "public/web/WebView.h" | 45 #include "public/web/WebView.h" |
| 46 #include "web/tests/FrameTestHelpers.h" | 46 #include "web/tests/FrameTestHelpers.h" |
| 47 #include "web/tests/URLTestHelpers.h" | 47 #include "web/tests/URLTestHelpers.h" |
| 48 #include <gtest/gtest.h> | 48 #include <gtest/gtest.h> |
| 49 | 49 |
| 50 using namespace blink; | 50 using namespace blink; |
| 51 using WebCore::Document; | 51 using blink::Document; |
| 52 using blink::FrameTestHelpers::runPendingTasks; | 52 using blink::FrameTestHelpers::runPendingTasks; |
| 53 using blink::URLTestHelpers::toKURL; | 53 using blink::URLTestHelpers::toKURL; |
| 54 using blink::URLTestHelpers::registerMockedURLLoad; | 54 using blink::URLTestHelpers::registerMockedURLLoad; |
| 55 | 55 |
| 56 namespace { | 56 namespace { |
| 57 | 57 |
| 58 class LineReader { | 58 class LineReader { |
| 59 public: | 59 public: |
| 60 LineReader(const std::string& text) : m_text(text), m_index(0) { } | 60 LineReader(const std::string& text) : m_text(text), m_index(0) { } |
| 61 bool getNextLine(std::string* line) | 61 bool getNextLine(std::string* line) |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 // exactly two times. | 488 // exactly two times. |
| 489 size_t nbDataURLs = 0; | 489 size_t nbDataURLs = 0; |
| 490 LineReader lineReader(std::string(mhtmlData.data())); | 490 LineReader lineReader(std::string(mhtmlData.data())); |
| 491 std::string line; | 491 std::string line; |
| 492 while (lineReader.getNextLine(&line)) { | 492 while (lineReader.getNextLine(&line)) { |
| 493 if (line.find("data:text") != std::string::npos) | 493 if (line.find("data:text") != std::string::npos) |
| 494 nbDataURLs++; | 494 nbDataURLs++; |
| 495 } | 495 } |
| 496 EXPECT_EQ(2u, nbDataURLs); | 496 EXPECT_EQ(2u, nbDataURLs); |
| 497 } | 497 } |
| OLD | NEW |