| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "FrameTestHelpers.h" | 7 #include "FrameTestHelpers.h" |
| 8 #include "bindings/core/v8/ScriptController.h" | 8 #include "bindings/core/v8/ScriptController.h" |
| 9 #include "bindings/core/v8/ScriptSourceCode.h" | 9 #include "bindings/core/v8/ScriptSourceCode.h" |
| 10 #include "bindings/core/v8/V8Binding.h" | 10 #include "bindings/core/v8/V8Binding.h" |
| 11 #include "bindings/core/v8/V8DOMActivityLogger.h" | 11 #include "bindings/core/v8/V8DOMActivityLogger.h" |
| 12 #include "web/WebLocalFrameImpl.h" | 12 #include "web/WebLocalFrameImpl.h" |
| 13 #include "wtf/Forward.h" | 13 #include "wtf/Forward.h" |
| 14 #include "wtf/text/Base64.h" | 14 #include "wtf/text/Base64.h" |
| 15 #include <gtest/gtest.h> | 15 #include <gtest/gtest.h> |
| 16 #include <v8.h> | 16 #include <v8.h> |
| 17 | 17 |
| 18 namespace { | 18 namespace blink { |
| 19 | 19 |
| 20 using blink::FrameTestHelpers::WebViewHelper; | 20 using blink::FrameTestHelpers::WebViewHelper; |
| 21 using blink::FrameTestHelpers::pumpPendingRequestsDoNotUse; | 21 using blink::FrameTestHelpers::pumpPendingRequestsDoNotUse; |
| 22 using namespace blink; | |
| 23 | 22 |
| 24 class TestActivityLogger : public V8DOMActivityLogger { | 23 class TestActivityLogger : public V8DOMActivityLogger { |
| 25 public: | 24 public: |
| 26 virtual ~TestActivityLogger() { } | 25 ~TestActivityLogger() override { } |
| 27 | 26 |
| 28 void logGetter(const String& apiName) override | 27 void logGetter(const String& apiName) override |
| 29 { | 28 { |
| 30 m_loggedActivities.append(apiName); | 29 m_loggedActivities.append(apiName); |
| 31 } | 30 } |
| 32 | 31 |
| 33 void logSetter(const String& apiName, const v8::Local<v8::Value>& newValue)
override | 32 void logSetter(const String& apiName, const v8::Local<v8::Value>& newValue)
override |
| 34 { | 33 { |
| 35 m_loggedActivities.append(apiName + " | " + toCoreStringWithUndefinedOrN
ullCheck(newValue)); | 34 m_loggedActivities.append(apiName + " | " + toCoreStringWithUndefinedOrN
ullCheck(newValue)); |
| 36 } | 35 } |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 "blinkRequestResource | CSS stylesheet | data:text/html;charset=utf-8,C\
n" | 517 "blinkRequestResource | CSS stylesheet | data:text/html;charset=utf-8,C\
n" |
| 519 "blinkAddElement | script | data:text/html;charset=utf-8,D\n" | 518 "blinkAddElement | script | data:text/html;charset=utf-8,D\n" |
| 520 "blinkRequestResource | Script | data:text/html;charset=utf-8,D\n" | 519 "blinkRequestResource | Script | data:text/html;charset=utf-8,D\n" |
| 521 "blinkRequestResource | XMLHttpRequest | data:text/html;charset=utf-8,E"
; | 520 "blinkRequestResource | XMLHttpRequest | data:text/html;charset=utf-8,E"
; |
| 522 executeScriptInMainWorld(code); | 521 executeScriptInMainWorld(code); |
| 523 ASSERT_TRUE(verifyActivities("")); | 522 ASSERT_TRUE(verifyActivities("")); |
| 524 executeScriptInIsolatedWorld(code); | 523 executeScriptInIsolatedWorld(code); |
| 525 ASSERT_TRUE(verifyActivities(expectedActivities)); | 524 ASSERT_TRUE(verifyActivities(expectedActivities)); |
| 526 } | 525 } |
| 527 | 526 |
| 528 } // namespace | 527 } // namespace blink |
| OLD | NEW |