OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 namespace { | 999 namespace { |
1000 | 1000 |
1001 RefPtr<SerializedScriptValue> serializeString(const StringView& message, | 1001 RefPtr<SerializedScriptValue> serializeString(const StringView& message, |
1002 ScriptState* scriptState) { | 1002 ScriptState* scriptState) { |
1003 // This is inefficient, but avoids duplicating serialization logic for the | 1003 // This is inefficient, but avoids duplicating serialization logic for the |
1004 // sake of this test. | 1004 // sake of this test. |
1005 NonThrowableExceptionState exceptionState; | 1005 NonThrowableExceptionState exceptionState; |
1006 ScriptState::Scope scope(scriptState); | 1006 ScriptState::Scope scope(scriptState); |
1007 V8ScriptValueSerializer serializer(scriptState); | 1007 V8ScriptValueSerializer serializer(scriptState); |
1008 return serializer.serialize(v8String(scriptState->isolate(), message), | 1008 return serializer.serialize(v8String(scriptState->isolate(), message), |
1009 nullptr, exceptionState); | 1009 exceptionState); |
1010 } | 1010 } |
1011 | 1011 |
1012 } // namespace | 1012 } // namespace |
1013 | 1013 |
1014 TEST_P(ParameterizedWebFrameTest, PostMessageThenDetach) { | 1014 TEST_P(ParameterizedWebFrameTest, PostMessageThenDetach) { |
1015 FrameTestHelpers::WebViewHelper webViewHelper; | 1015 FrameTestHelpers::WebViewHelper webViewHelper; |
1016 webViewHelper.initializeAndLoad("about:blank"); | 1016 webViewHelper.initializeAndLoad("about:blank"); |
1017 | 1017 |
1018 LocalFrame* frame = | 1018 LocalFrame* frame = |
1019 toLocalFrame(webViewHelper.webView()->page()->mainFrame()); | 1019 toLocalFrame(webViewHelper.webView()->page()->mainFrame()); |
(...skipping 10489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11509 EXPECT_FALSE(testSelectAll("<textarea></textarea>")); | 11509 EXPECT_FALSE(testSelectAll("<textarea></textarea>")); |
11510 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>")); | 11510 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>")); |
11511 EXPECT_FALSE(testSelectAll("<input>")); | 11511 EXPECT_FALSE(testSelectAll("<input>")); |
11512 EXPECT_TRUE(testSelectAll("<input value='nonempty'>")); | 11512 EXPECT_TRUE(testSelectAll("<input value='nonempty'>")); |
11513 // TODO(amaralp): Empty contenteditable should not have select all enabled. | 11513 // TODO(amaralp): Empty contenteditable should not have select all enabled. |
11514 EXPECT_TRUE(testSelectAll("<div contenteditable></div>")); | 11514 EXPECT_TRUE(testSelectAll("<div contenteditable></div>")); |
11515 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>")); | 11515 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>")); |
11516 } | 11516 } |
11517 | 11517 |
11518 } // namespace blink | 11518 } // namespace blink |
OLD | NEW |