I've updated
https://bit.ly/v8-extras to be clearer about how things work in the GN world. See the instructions in the
"Adding a V8 Extra" section. In particular, if you're trying to add one to Chrome, you shouldn't be editing V8's .gn file. Instead you should be editing Chrome's.
As for "can't run my test javascript", that's very vague. I'd suggest you start out with something very simple, such as the one in the doc, or perhaps something even simpler, like
(function (global) {
global.testV8ExtraProp = "test";
});
and see if you can get that working first (i.e., build Chrome with that change, then open up the dev tools console and see if window.testV8Prop exists). Then build up from there.