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

Unified Diff: third_party/grpc/src/php/tests/unit_tests/ChannelTest.php

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/grpc/src/php/tests/unit_tests/ChannelTest.php
diff --git a/third_party/WebKit/Source/modules/filesystem/FileWriterBase.h b/third_party/grpc/src/php/tests/unit_tests/ChannelTest.php
similarity index 60%
copy from third_party/WebKit/Source/modules/filesystem/FileWriterBase.h
copy to third_party/grpc/src/php/tests/unit_tests/ChannelTest.php
index 89d97d98121bc0ea996a5dda9d1c8f5923a9c6cf..acb8a0a70d58d870a7111a9c23e3963680ca88c7 100644
--- a/third_party/WebKit/Source/modules/filesystem/FileWriterBase.h
+++ b/third_party/grpc/src/php/tests/unit_tests/ChannelTest.php
@@ -1,5 +1,8 @@
+<?php
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Copyright 2015-2016, Google Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -26,61 +29,54 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
*/
-#ifndef FileWriterBase_h
-#define FileWriterBase_h
-
-#include "platform/heap/Handle.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-
-namespace blink {
-
-class WebFileWriter;
-
-class FileWriterBase : public GarbageCollectedMixin {
-public:
- virtual ~FileWriterBase();
- void initialize(PassOwnPtr<WebFileWriter>, long long length);
-
- long long position() const
+class ChannelTest extends PHPUnit_Framework_TestCase
+{
+ public function setUp()
{
- return m_position;
}
- long long length() const
+
+ public function tearDown()
{
- return m_length;
}
- DEFINE_INLINE_VIRTUAL_TRACE() { }
-
-protected:
- FileWriterBase();
-
- WebFileWriter* writer()
+ public function testInsecureCredentials()
{
- return m_writer.get();
+ $this->channel = new Grpc\Channel(
+ 'localhost:0',
+ [
+ 'credentials' => Grpc\ChannelCredentials::createInsecure(),
+ ]
+ );
+ $this->assertSame('Grpc\Channel', get_class($this->channel));
}
- void setPosition(long long position)
+ /**
+ * @expectedException InvalidArgumentException
+ */
+ public function testInvalidCredentials()
{
- m_position = position;
+ $this->channel = new Grpc\Channel(
+ 'localhost:0',
+ [
+ 'credentials' => new Grpc\Timeval(100),
+ ]
+ );
}
- void setLength(long long length)
+ /**
+ * @expectedException InvalidArgumentException
+ */
+ public function testInvalidOptionsArray()
{
- m_length = length;
+ $this->channel = new Grpc\Channel(
+ 'localhost:0',
+ [
+ 'abc' => [],
+ ]
+ );
}
- void seekInternal(long long position);
-
-private:
- OwnPtr<WebFileWriter> m_writer;
- long long m_position;
- long long m_length;
-};
-
-} // namespace blink
-
-#endif // FileWriterBase_h
+}

Powered by Google App Engine
This is Rietveld 408576698