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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/RequestTest.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 "modules/fetch/Request.h" 5 #include "modules/fetch/Request.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/frame/Frame.h" 10 #include "core/frame/Frame.h"
11 #include "core/testing/DummyPageHolder.h" 11 #include "core/testing/DummyPageHolder.h"
12 #include "public/platform/WebURLRequest.h" 12 #include "public/platform/WebURLRequest.h"
13 #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h" 13 #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 #include "wtf/HashMap.h" 15 #include "wtf/HashMap.h"
16 #include "wtf/text/WTFString.h" 16 #include "wtf/text/WTFString.h"
17 #include <memory>
18 17
19 namespace blink { 18 namespace blink {
20 namespace { 19 namespace {
21 20
22 class ServiceWorkerRequestTest : public ::testing::Test { 21 class ServiceWorkerRequestTest : public ::testing::Test {
23 public: 22 public:
24 ServiceWorkerRequestTest() 23 ServiceWorkerRequestTest()
25 : m_page(DummyPageHolder::create(IntSize(1, 1))) { } 24 : m_page(DummyPageHolder::create(IntSize(1, 1))) { }
26 25
27 ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->doc ument().frame()); } 26 ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->doc ument().frame()); }
28 ExecutionContext* getExecutionContext() { return getScriptState()->getExecut ionContext(); } 27 ExecutionContext* getExecutionContext() { return getScriptState()->getExecut ionContext(); }
29 28
30 private: 29 private:
31 std::unique_ptr<DummyPageHolder> m_page; 30 OwnPtr<DummyPageHolder> m_page;
32 }; 31 };
33 32
34 TEST_F(ServiceWorkerRequestTest, FromString) 33 TEST_F(ServiceWorkerRequestTest, FromString)
35 { 34 {
36 TrackExceptionState exceptionState; 35 TrackExceptionState exceptionState;
37 36
38 KURL url(ParsedURLString, "http://www.example.com/"); 37 KURL url(ParsedURLString, "http://www.example.com/");
39 Request* request = Request::create(getScriptState(), url, exceptionState); 38 Request* request = Request::create(getScriptState(), url, exceptionState);
40 ASSERT_FALSE(exceptionState.hadException()); 39 ASSERT_FALSE(exceptionState.hadException());
41 ASSERT(request); 40 ASSERT(request);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 Request* request = Request::create(getScriptState(), url, exceptionState); 117 Request* request = Request::create(getScriptState(), url, exceptionState);
119 ASSERT(request); 118 ASSERT(request);
120 119
121 WebServiceWorkerRequest webRequest; 120 WebServiceWorkerRequest webRequest;
122 request->populateWebServiceWorkerRequest(webRequest); 121 request->populateWebServiceWorkerRequest(webRequest);
123 EXPECT_EQ(urlWithoutFragment, KURL(webRequest.url())); 122 EXPECT_EQ(urlWithoutFragment, KURL(webRequest.url()));
124 } 123 }
125 124
126 } // namespace 125 } // namespace
127 } // namespace blink 126 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/RequestInit.h ('k') | third_party/WebKit/Source/modules/fetch/Response.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698