Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Side by Side Diff: Source/web/tests/ActivityLoggerTest.cpp

Issue 847803002: Make ScriptStreamer and dependents Oilpan friendly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add ScriptSourceCode::isNull() comment Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/V8Binding.h" 10 #include "bindings/core/v8/V8Binding.h"
10 #include "bindings/core/v8/V8DOMActivityLogger.h" 11 #include "bindings/core/v8/V8DOMActivityLogger.h"
11 #include "web/WebLocalFrameImpl.h" 12 #include "web/WebLocalFrameImpl.h"
12 #include "wtf/Forward.h" 13 #include "wtf/Forward.h"
13 #include "wtf/text/Base64.h" 14 #include "wtf/text/Base64.h"
14 #include <gtest/gtest.h> 15 #include <gtest/gtest.h>
15 #include <v8.h> 16 #include <v8.h>
16 17
17 namespace { 18 namespace {
18 19
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 void executeScriptInMainWorld(const String& script) const 72 void executeScriptInMainWorld(const String& script) const
72 { 73 {
73 v8::HandleScope scope(v8::Isolate::GetCurrent()); 74 v8::HandleScope scope(v8::Isolate::GetCurrent());
74 m_scriptController->executeScriptInMainWorld(script); 75 m_scriptController->executeScriptInMainWorld(script);
75 pumpPendingRequestsDoNotUse(m_webViewHelper.webViewImpl()->mainFrame()); 76 pumpPendingRequestsDoNotUse(m_webViewHelper.webViewImpl()->mainFrame());
76 } 77 }
77 78
78 void executeScriptInIsolatedWorld(const String& script) const 79 void executeScriptInIsolatedWorld(const String& script) const
79 { 80 {
80 v8::HandleScope scope(v8::Isolate::GetCurrent()); 81 v8::HandleScope scope(v8::Isolate::GetCurrent());
81 Vector<ScriptSourceCode> sources; 82 WillBeHeapVector<ScriptSourceCode> sources;
82 sources.append(ScriptSourceCode(script)); 83 sources.append(ScriptSourceCode(script));
83 Vector<v8::Local<v8::Value>> results; 84 Vector<v8::Local<v8::Value>> results;
84 m_scriptController->executeScriptInIsolatedWorld(isolatedWorldId, source s, extensionGroup, 0); 85 m_scriptController->executeScriptInIsolatedWorld(isolatedWorldId, source s, extensionGroup, 0);
85 pumpPendingRequestsDoNotUse(m_webViewHelper.webViewImpl()->mainFrame()); 86 pumpPendingRequestsDoNotUse(m_webViewHelper.webViewImpl()->mainFrame());
86 } 87 }
87 88
88 bool verifyActivities(const String& activities) 89 bool verifyActivities(const String& activities)
89 { 90 {
90 Vector<String> activityVector; 91 Vector<String> activityVector;
91 activities.split("\n", activityVector); 92 activities.split("\n", activityVector);
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 "blinkAddElement | script | data:text/html;charset=utf-8,D\n" 518 "blinkAddElement | script | data:text/html;charset=utf-8,D\n"
518 "blinkRequestResource | Script | data:text/html;charset=utf-8,D\n" 519 "blinkRequestResource | Script | data:text/html;charset=utf-8,D\n"
519 "blinkRequestResource | XMLHttpRequest | data:text/html;charset=utf-8,E" ; 520 "blinkRequestResource | XMLHttpRequest | data:text/html;charset=utf-8,E" ;
520 executeScriptInMainWorld(code); 521 executeScriptInMainWorld(code);
521 ASSERT_TRUE(verifyActivities("")); 522 ASSERT_TRUE(verifyActivities(""));
522 executeScriptInIsolatedWorld(code); 523 executeScriptInIsolatedWorld(code);
523 ASSERT_TRUE(verifyActivities(expectedActivities)); 524 ASSERT_TRUE(verifyActivities(expectedActivities));
524 } 525 }
525 526
526 } // namespace 527 } // namespace
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698