Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
72002d88
Commit
72002d88
authored
Nov 22, 2016
by
Adam Cozzette
Committed by
GitHub
Nov 22, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2400 from acozzette/jspb-test-fixes
Fixed JSPB test failures
parents
04bd6147
fda876a1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
10 deletions
+16
-10
proto_test.js
js/binary/proto_test.js
+1
-1
export.js
js/commonjs/export.js
+1
-0
export_testdeps.js
js/commonjs/export_testdeps.js
+1
-0
gulpfile.js
js/gulpfile.js
+3
-3
jasmine.json
js/jasmine.json
+4
-1
message_test.js
js/message_test.js
+3
-2
test.proto
js/test.proto
+3
-3
No files found.
js/binary/proto_test.js
View file @
72002d88
...
...
@@ -88,7 +88,7 @@ goog.require('proto.jspb.test.extendRepeatedStringList');
goog
.
require
(
'proto.jspb.test.extendRepeatedUint32List'
);
goog
.
require
(
'proto.jspb.test.extendRepeatedUint64List'
);
// CommonJS-LoadFromFile: google/protobuf/any_pb proto.google.protobuf
// CommonJS-LoadFromFile:
../node_modules/google-protobuf/
google/protobuf/any_pb proto.google.protobuf
goog
.
require
(
'proto.google.protobuf.Any'
);
...
...
js/commonjs/export.js
View file @
72002d88
...
...
@@ -24,3 +24,4 @@ exports.ExtensionFieldBinaryInfo = jspb.ExtensionFieldBinaryInfo;
exports
.
exportSymbol
=
goog
.
exportSymbol
;
exports
.
inherits
=
goog
.
inherits
;
exports
.
object
=
{
extend
:
goog
.
object
.
extend
};
exports
.
typeOf
=
goog
.
typeOf
;
js/commonjs/export_testdeps.js
View file @
72002d88
...
...
@@ -12,6 +12,7 @@ goog.require('jspb.arith.Int64');
goog
.
require
(
'jspb.arith.UInt64'
);
goog
.
require
(
'jspb.BinaryEncoder'
);
goog
.
require
(
'jspb.BinaryDecoder'
);
goog
.
require
(
'jspb.BinaryWriter'
);
goog
.
require
(
'jspb.utils'
);
exports
.
goog
=
goog
;
...
...
js/gulpfile.js
View file @
72002d88
...
...
@@ -24,7 +24,7 @@ var wellKnownTypes = [
];
gulp
.
task
(
'genproto_closure'
,
function
(
cb
)
{
exec
(
protoc
+
' --js_out=library=testproto_libs,binary:. -I ../src -I . *.proto
../src/google/protobuf/descriptor.proto'
,
exec
(
protoc
+
' --js_out=library=testproto_libs,binary:. -I ../src -I . *.proto
&& '
+
protoc
+
' --js_out=one_output_file_per_input_file,binary:. -I ../src -I . '
+
wellKnownTypes
.
join
(
' '
)
,
function
(
err
,
stdout
,
stderr
)
{
console
.
log
(
stdout
);
console
.
log
(
stderr
);
...
...
@@ -33,7 +33,7 @@ gulp.task('genproto_closure', function (cb) {
});
gulp
.
task
(
'genproto_commonjs'
,
function
(
cb
)
{
exec
(
'mkdir -p commonjs_out && '
+
protoc
+
' --js_out=import_style=commonjs,binary:commonjs_out -I ../src -I commonjs -I . *.proto commonjs/test*/*.proto
../src/google/protobuf/descriptor.proto'
,
exec
(
'mkdir -p commonjs_out && '
+
protoc
+
' --js_out=import_style=commonjs,binary:commonjs_out -I ../src -I commonjs -I . *.proto commonjs/test*/*.proto
'
+
wellKnownTypes
.
join
(
' '
)
,
function
(
err
,
stdout
,
stderr
)
{
console
.
log
(
stdout
);
console
.
log
(
stderr
);
...
...
@@ -42,7 +42,7 @@ gulp.task('genproto_commonjs', function (cb) {
});
gulp
.
task
(
'genproto_commonjs_wellknowntypes'
,
function
(
cb
)
{
exec
(
'mkdir -p commonjs_out/node_modules/google-protobuf && '
+
protoc
+
' --js_out=import_style=commonjs,binary:commonjs_out/node_modules/google-protobuf -I ../src
../src/google/protobuf/descriptor.proto'
,
exec
(
'mkdir -p commonjs_out/node_modules/google-protobuf && '
+
protoc
+
' --js_out=import_style=commonjs,binary:commonjs_out/node_modules/google-protobuf -I ../src
'
+
wellKnownTypes
.
join
(
' '
)
,
function
(
err
,
stdout
,
stderr
)
{
console
.
log
(
stdout
);
console
.
log
(
stderr
);
...
...
js/jasmine.json
View file @
72002d88
...
...
@@ -7,6 +7,9 @@
"helpers"
:
[
"node_modules/google-closure-library/closure/goog/bootstrap/nodejs.js"
,
"node_loader.js"
,
"deps.js"
"deps.js"
,
"google/protobuf/any.js"
,
"google/protobuf/struct.js"
,
"google/protobuf/timestamp.js"
]
}
js/message_test.js
View file @
72002d88
...
...
@@ -1049,12 +1049,13 @@ describe('Message test suite', function() {
var
nested
=
new
proto
.
jspb
.
test
.
Deeply
.
Nested
.
Message
();
nested
.
setCount
(
5
);
msg
.
setDeeplyNestedMessage
(
nested
);
assertEquals
(
5
,
msg
.
getDeeplyNestedMessage
().
getCount
());
// After a serialization-deserialization round trip we should get back the
// same data we started with.
var
serialized
=
msg
.
toObject
();
var
serialized
=
msg
.
serializeBinary
();
var
deserialized
=
proto
.
jspb
.
test
.
ForeignNestedFieldMessage
.
fromObject
(
serialized
);
proto
.
jspb
.
test
.
ForeignNestedFieldMessage
.
deserializeBinary
(
serialized
);
assertEquals
(
5
,
deserialized
.
getDeeplyNestedMessage
().
getCount
());
});
...
...
js/test.proto
View file @
72002d88
...
...
@@ -254,9 +254,9 @@ message TestMapFieldsNoBinary {
}
enum
MapValueEnumNoBinary
{
MAP_VALUE_FOO
=
0
;
MAP_VALUE_BAR
=
1
;
MAP_VALUE_BAZ
=
2
;
MAP_VALUE_FOO
_NOBINARY
=
0
;
MAP_VALUE_BAR
_NOBINARY
=
1
;
MAP_VALUE_BAZ
_NOBINARY
=
2
;
}
message
MapValueMessageNoBinary
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment