1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 #include "core/page/PagePopupClient.h"
8 #include <gtest/gtest.h>
13 TEST(PagePopupClientTest
, AddJavaScriptString
)
15 RefPtr
<SharedBuffer
> buffer
= SharedBuffer::create();
16 PagePopupClient::addJavaScriptString(String::fromUTF8("abc\r\n'\"</script>\t\f\v\xE2\x80\xA8\xE2\x80\xA9"), buffer
.get());
17 EXPECT_EQ("\"abc\\r\\n'\\\"\\x3C/script>\\u0009\\u000C\\u000B\\u2028\\u2029\"", std::string(buffer
->data(), buffer
->size()));