| 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 "bindings/core/v8/ScriptController.h" | 5 #include "bindings/core/v8/ScriptController.h" |
| 6 #include "bindings/core/v8/ScriptSourceCode.h" | 6 #include "bindings/core/v8/ScriptSourceCode.h" |
| 7 #include "bindings/core/v8/V8Binding.h" | 7 #include "bindings/core/v8/V8Binding.h" |
| 8 #include "bindings/core/v8/V8DOMActivityLogger.h" | 8 #include "bindings/core/v8/V8DOMActivityLogger.h" |
| 9 #include "public/web/WebCache.h" | 9 #include "public/web/WebCache.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 Vector<String> m_loggedActivities; | 69 Vector<String> m_loggedActivities; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 class ActivityLoggerTest : public testing::Test { | 72 class ActivityLoggerTest : public testing::Test { |
| 73 protected: | 73 protected: |
| 74 ActivityLoggerTest() { | 74 ActivityLoggerTest() { |
| 75 m_activityLogger = new TestActivityLogger(); | 75 m_activityLogger = new TestActivityLogger(); |
| 76 V8DOMActivityLogger::setActivityLogger(isolatedWorldId, String(), | 76 V8DOMActivityLogger::setActivityLogger(isolatedWorldId, String(), |
| 77 wrapUnique(m_activityLogger)); | 77 WTF::wrapUnique(m_activityLogger)); |
| 78 m_webViewHelper.initialize(true); | 78 m_webViewHelper.initialize(true); |
| 79 m_scriptController = | 79 m_scriptController = |
| 80 &m_webViewHelper.webView()->mainFrameImpl()->frame()->script(); | 80 &m_webViewHelper.webView()->mainFrameImpl()->frame()->script(); |
| 81 FrameTestHelpers::loadFrame(m_webViewHelper.webView()->mainFrame(), | 81 FrameTestHelpers::loadFrame(m_webViewHelper.webView()->mainFrame(), |
| 82 "about:blank"); | 82 "about:blank"); |
| 83 } | 83 } |
| 84 | 84 |
| 85 ~ActivityLoggerTest() { WebCache::clear(); } | 85 ~ActivityLoggerTest() { WebCache::clear(); } |
| 86 | 86 |
| 87 void executeScriptInMainWorld(const String& script) const { | 87 void executeScriptInMainWorld(const String& script) const { |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 "blinkAddElement | script | data:text/html;charset=utf-8,D\n" | 586 "blinkAddElement | script | data:text/html;charset=utf-8,D\n" |
| 587 "blinkRequestResource | Script | data:text/html;charset=utf-8,D\n" | 587 "blinkRequestResource | Script | data:text/html;charset=utf-8,D\n" |
| 588 "blinkRequestResource | XMLHttpRequest | data:text/html;charset=utf-8,E"; | 588 "blinkRequestResource | XMLHttpRequest | data:text/html;charset=utf-8,E"; |
| 589 executeScriptInMainWorld(code); | 589 executeScriptInMainWorld(code); |
| 590 ASSERT_TRUE(verifyActivities("")); | 590 ASSERT_TRUE(verifyActivities("")); |
| 591 executeScriptInIsolatedWorld(code); | 591 executeScriptInIsolatedWorld(code); |
| 592 ASSERT_TRUE(verifyActivities(expectedActivities)); | 592 ASSERT_TRUE(verifyActivities(expectedActivities)); |
| 593 } | 593 } |
| 594 | 594 |
| 595 } // namespace blink | 595 } // namespace blink |
| OLD | NEW |