#!/usr/bin/env python
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import httparchive
import script_injector
import unittest
LONG_COMMENT = ''
COMMENT_OR_NOT = ('', LONG_COMMENT)
SCRIPT_TO_INJECT = 'var flag = 0;'
EXPECTED_SCRIPT = ''
TEXT_HTML = 'text/html'
TEXT_CSS = 'text/css'
APPLICATION = 'application/javascript'
SEPARATOR = httparchive.ArchivedHttpResponse.CHUNK_EDIT_SEPARATOR
SEPARATORS_OR_NOT = ('', SEPARATOR, SEPARATOR*3)
TEMPLATE_HEAD = """\
{boundary_at_start}\
{boundary_after_doctype}\
{boundary_after_html}\
{injection}{boundary_after_head}\