<commit_before>// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@TestOn('dartium')
library test.form.browser;

import 'dart:convert';
import 'dart:html';

import 'package:test/test.dart';

void main() {
  group('POST multipart/form-data', () {
    test('post-simple', () async {
      final form = new FormData()
        ..append('field1', 'hello')
        ..append('field2', 'world');
      final response = await HttpRequest.request(
          'http://localhost:4242/testAPI/v1/post/simple',
          method: 'POST',
          sendData: form);
      final result = JSON.decode(response.responseText);
      expect('hello', equals(result['field1']));
      expect('world', equals(result['field2']));
    });<commit_msg>mark form test as support all browsers, not just dartium<commit_after>// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@TestOn('browser')
library test.form.browser;

import 'dart:convert';
import 'dart:html';

import 'package:test/test.dart';

void main() {
  group('POST multipart/form-data', () {
    test('post-simple', () async {
      final form = new FormData()
        ..append('field1', 'hello')
        ..append('field2', 'world');
      final response = await HttpRequest.request(
          'http://localhost:4242/testAPI/v1/post/simple',
          method: 'POST',
          sendData: form);
      final result = JSON.decode(response.responseText);
      expect('hello', equals(result['field1']));
      expect('world', equals(result['field2']));
    });
{'fraction_non_alphanumeric': 0.14881933003844042, 'fraction_numerical': 0.014277869302580999, 'mean_word_length': 3.276995305164319, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6618869', 'n_tokens_mistral': 546, 'n_tokens_neox': 529, 'n_words': 161}