Skip to content

Commit d9a2071

Browse files
committed
Initial commit
0 parents  commit d9a2071

File tree

135 files changed

+18871
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+18871
-0
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.env

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
REACT_APP_VENDOR=IAB
2+
REACT_APP_NAME=VAST Tester
3+
REACT_APP_VERSION=$npm_package_version

.env.development

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
REACT_APP_VERSION=$npm_package_version+dev
2+
REACT_APP_BUILD_DATE=Mon Jan 1 00:00:00 GMT 2018

.env.production

Whitespace-only changes.

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
6+
# testing
7+
/coverage
8+
9+
# production
10+
/build
11+
12+
# misc
13+
.DS_Store
14+
.env.local
15+
.env.development.local
16+
.env.test.local
17+
.env.production.local
18+
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+
23+
.deployment

README.md

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# IAB VAST Tester
2+
3+
[![JavaScript Standard Style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://standardjs.com/)
4+
5+
Tests IAB VAST ads. Contributed by the [Zentrick](https://www.zentrick.com/) team.
6+
7+
## Getting Started
8+
9+
Install dependencies:
10+
11+
```bash
12+
yarn
13+
```
14+
15+
Get developing:
16+
17+
```bash
18+
yarn start
19+
```
20+
21+
Create a production build:
22+
23+
```bash
24+
yarn run build
25+
```
26+
27+
Tag and deploy a new version:
28+
29+
```bash
30+
yarn version
31+
```
32+
33+
## Architecture
34+
35+
This is a [React](https://reactjs.org/) app bootstrapped with
36+
[Create React App](https://github.com/facebookincubator/create-react-app).
37+
All state is maintained using [Redux](https://redux.js.org/). Side effects of
38+
state mutation are modeled using
39+
[redux-observable](https://redux-observable.js.org/).
40+
41+
The app can be broken down into two sub-apps, which each live in a subdirectory
42+
of [`src/`](src/). The largest of the two is called [_main_](src/main/) and
43+
contains just about the whole tester. The second sub-app,
44+
[_verification_](src/verification/), houses a host for OMID scripts, which gets
45+
loaded into an iframe for every verification script.
46+
47+
The apps talk to one another using the [`rpc` subpackage](src/common/rpc/) that
48+
is also part of this repository. This is a friendly interface to the browser's
49+
[`postMessage()` API](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage).
50+
51+
The top-level app has a [single entry point](src/index.js) that routes between
52+
the two sub-apps based on the URL. This started out as a limitation of Create
53+
React App, which only allows us to produce a single bundle, but we actually
54+
prefer it now.
55+
56+
The _verification_ sub-app is a single React component that implements the
57+
OMID interface. It does not use Redux at all.
58+
59+
In the _main_ app, there are subdirectories for the standard React-Redux model:
60+
61+
- [`components/`](src/main/components/): React components (without Redux);
62+
- [`containers/`](src/main/containers/): React components connected to Redux's
63+
store;
64+
- [`actions/`](src/main/actions/): Redux action definitions;
65+
- [`reducers/`](src/main/reducers/): Redux reducers;
66+
- [`epics/`](src/main/epics/): epics for redux-observable;
67+
- [`middleware/`](src/main/middleware/): Redux middleware.
68+
69+
In addition to those, there are also:
70+
71+
- [`util/`](src/main/util/): various utility modules;
72+
- [`style/`](src/main/style): [Sass](https://sass-lang.com/) style sheets for
73+
the app.
74+
75+
More detailed documentation will be added at a later stage. For now, we suggest
76+
exploring the source code.
77+
78+
## Debugging
79+
80+
During development, you can use:
81+
82+
- [React DevTools](https://github.com/facebook/react-devtools)
83+
for React's DOM;
84+
- [Redux DevTools](https://github.com/zalmoxisus/redux-devtools-extension)
85+
for Redux actions and redux-observable effects;
86+
- [Logger for Redux](https://github.com/evgenyrodionov/redux-logger)
87+
by setting `localStorage.reduxLogger` to `true`;
88+
- [debug](https://www.npmjs.com/package/debug)
89+
by setting `localStorage.debug` to `'rpc:*'`.
90+
91+
## To Do
92+
93+
- Resize support
94+
- Canned test scenarios
95+
- Reporting and recommendations
96+
- VAST validation
97+
98+
## Contributing
99+
100+
We welcome pull requests for bug fixes and new features.

package.json

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"name": "VAST-Tester",
3+
"version": "0.0.0",
4+
"description": "Tests IAB VAST ads.",
5+
"private": true,
6+
"repository": "InteractiveAdvertisingBureau/VAST-Tester",
7+
"engines": {
8+
"node": ">=8",
9+
"yarn": ">=1.7.0"
10+
},
11+
"browserslist": [
12+
">0.2%",
13+
"not dead",
14+
"not ie <= 11",
15+
"not op_mini all"
16+
],
17+
"homepage": "//vasttester.iab.com",
18+
"homepageAlt": "//vasttester2.iab.com",
19+
"scripts": {
20+
"start": "react-scripts start",
21+
"clean": "rimraf build",
22+
"build": "yarn run clean && REACT_APP_BUILD_DATE=\"$(TZ=GMT date)\" react-scripts build",
23+
"test": "standard \"src/**/*.js\"",
24+
"deploy": "yarn run build && scripts/deploy.sh",
25+
"postversion": "yarn run deploy"
26+
},
27+
"dependencies": {
28+
"@babel/polyfill": "^7.0.0",
29+
"base16": "^1.0.0",
30+
"debug": "^4.1.0",
31+
"file-saver": "^2.0.0-rc.4",
32+
"font-awesome": "^4.7.0",
33+
"husky": "^1.1.3",
34+
"iab-vast-loader": "^2.0.0",
35+
"lint-staged": "^8.0.4",
36+
"lodash-es": "^4.17.11",
37+
"lower-case-first": "^1.0.2",
38+
"moment": "^2.22.2",
39+
"node-sass": "^4.10.0",
40+
"prettier-standard": "^8.0.1",
41+
"prop-types": "^15.6.2",
42+
"qs": "^6.5.2",
43+
"react": "^16.6.1",
44+
"react-collapsible": "^2.3.1",
45+
"react-copy-to-clipboard": "^5.0.1",
46+
"react-dom": "^16.6.1",
47+
"react-fontawesome": "^1.6.1",
48+
"react-ga": "^2.5.3",
49+
"react-json-tree": "^0.11.0",
50+
"react-redux": "^5.1.0",
51+
"react-router-dom": "^4.3.1",
52+
"react-scripts": "2.1.1",
53+
"react-tabs": "^2.3.0",
54+
"react-toggle": "^4.0.2",
55+
"redux": "^4.0.1",
56+
"redux-actions": "^2.6.4",
57+
"redux-devtools-extension": "^2.13.5",
58+
"redux-logger": "^3.0.6",
59+
"redux-observable": "^1.0.0",
60+
"reset-css": "^4.0.1",
61+
"rimraf": "^2.6.2",
62+
"rxjs": "^6.3.3",
63+
"serialize-error": "^3.0.0",
64+
"standard": "^12.0.1",
65+
"upper-case-first": "^1.1.2",
66+
"url-search-params": "^1.1.0"
67+
},
68+
"lint-staged": {
69+
"src/**/*.js": [
70+
"prettier-standard",
71+
"git add"
72+
]
73+
},
74+
"standard": {
75+
"globals": [
76+
"Blob"
77+
]
78+
},
79+
"husky": {
80+
"hooks": {
81+
"pre-commit": "lint-staged"
82+
}
83+
}
84+
}

public/favicon.ico

1.12 KB
Binary file not shown.

public/fixtures/omid/omid-dummy.js

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
(function (omidClient) {
2+
var VENDOR_KEY = 'unknown'
3+
4+
var EVENT_TYPES = [
5+
'impression',
6+
'loaded',
7+
'start',
8+
'firstQuartile',
9+
'midpoint',
10+
'thirdQuartile',
11+
'complete',
12+
'pause',
13+
'resume',
14+
'bufferStart',
15+
'bufferFinish',
16+
'skipped',
17+
'volumeChange',
18+
'playerStateChange',
19+
'adUserInteraction',
20+
'geometryChange'
21+
]
22+
23+
if (document.currentScript != null) {
24+
var scriptUri = document.currentScript.src
25+
var pos = scriptUri.indexOf('?')
26+
if (pos >= 0) {
27+
VENDOR_KEY = scriptUri.substr(pos + 1)
28+
}
29+
}
30+
31+
var logger = {}
32+
;['info', 'warn', 'error'].forEach(function (level) {
33+
logger[level] = function () {
34+
var args = Array.prototype.slice.call(arguments)
35+
args[0] = '[OMID ' + VENDOR_KEY + '] ' + args[0]
36+
console[level].apply(console, args)
37+
}
38+
})
39+
40+
if (omidClient == null) {
41+
logger.error('OMID API not available')
42+
return
43+
}
44+
45+
var onEvent = function (prefix) {
46+
return function (evt) {
47+
logger.info(prefix + ': ' + evt.type + ', data:', evt.data)
48+
}
49+
}
50+
51+
omidClient.registerSessionObserver(onEvent('Session event'), VENDOR_KEY)
52+
53+
var onLifecycleEvent = onEvent('Lifecycle event')
54+
for (var i = 0; i < EVENT_TYPES.length; ++i) {
55+
omidClient.addEventListener(EVENT_TYPES[i], onLifecycleEvent)
56+
}
57+
})(window.omid3p)
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<VAST version="3.0">
2+
<Ad id="demo">
3+
<InLine>
4+
<AdSystem version="1.0">Demo</AdSystem>
5+
<AdTitle>
6+
<![CDATA[Demo]]>
7+
</AdTitle>
8+
<Description>
9+
<![CDATA[Just a demonstration.]]>
10+
</Description>
11+
<Error>
12+
<![CDATA[https://example.com/error?code=[ERRORCODE]&_=[CACHEBUSTING]]]>
13+
</Error>
14+
<Impression>
15+
<![CDATA[https://example.com/impression?_=[CACHEBUSTING]]]>
16+
</Impression>
17+
<Creatives>
18+
<Creative>
19+
<Linear>
20+
<Duration>00:00:17.320</Duration>
21+
<AdParameters>
22+
<![CDATA[{"mediaFiles":[{"delivery":"progressive","type":"video/webm","width":640,"height":360,"uri":"https://assets.zentrick.io/h/he/heetb2ic/media/360p30.webm"},{"delivery":"progressive","type":"video/mp4","width":640,"height":360,"uri":"https://assets.zentrick.io/h/he/heetb2ic/media/360p30.mp4"}]}]]>
23+
</AdParameters>
24+
<MediaFiles>
25+
<MediaFile delivery="progressive" type="application/javascript" width="16" height="9" apiFramework="VPAID">
26+
<![CDATA[/fixtures/vpaid/vpaid-video.js]]>
27+
</MediaFile>
28+
<MediaFile delivery="progressive" type="video/webm" width="640" height="360">
29+
<![CDATA[https://assets.zentrick.io/h/he/heetb2ic/media/360p30.webm]]>
30+
</MediaFile>
31+
<MediaFile delivery="progressive" type="video/mp4" width="640" height="360">
32+
<![CDATA[https://assets.zentrick.io/h/he/heetb2ic/media/360p30.mp4]]>
33+
</MediaFile>
34+
</MediaFiles>
35+
</Linear>
36+
</Creative>
37+
</Creatives>
38+
<Extensions>
39+
<Extension type="AdVerifications">
40+
<AdVerifications>
41+
<Verification vendor="vendor1">
42+
<JavaScriptResource apiFramework="omid">
43+
<![CDATA[/fixtures/omid/omid-dummy.js?vendor1]]>
44+
</JavaScriptResource>
45+
</Verification>
46+
<Verification vendor="vendor2">
47+
<JavaScriptResource apiFramework="omid">
48+
<![CDATA[/fixtures/omid/omid-dummy.js?vendor2]]>
49+
</JavaScriptResource>
50+
</Verification>
51+
<Verification vendor="invalid">
52+
<JavaScriptResource apiFramework="omid">
53+
<![CDATA[https://unknown.dev/omid_verification.js]]>
54+
</JavaScriptResource>
55+
</Verification>
56+
</AdVerifications>
57+
</Extension>
58+
</Extensions>
59+
</InLine>
60+
</Ad>
61+
</VAST>

0 commit comments

Comments
 (0)