Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1459)

Issue 10959002: Read locales over http in the browser (Closed)

Created:
8 years, 3 months ago by Alan Knight
Modified:
8 years, 2 months ago
CC:
reviews_dartlang.org, Bill Hesse, ahe
Visibility:
Public.

Description

Read locales over http in the browser Committed: https://code.google.com/p/dart/source/detail?r=12664

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 7

Patch Set 5 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+236 lines, -6 lines) Patch
A pkg/intl/lib/date_symbol_data_http_request.dart View 1 1 chunk +42 lines, -0 lines 0 comments Download
A pkg/intl/lib/src/http_request_data_reader.dart View 1 1 chunk +29 lines, -0 lines 0 comments Download
A pkg/intl/test/date_time_format_http_request_test.dart View 1 2 3 4 1 chunk +44 lines, -0 lines 0 comments Download
A pkg/intl/test/start_web_server.dart View 1 1 chunk +24 lines, -0 lines 0 comments Download
A pkg/intl/test/web_server.dart View 1 1 chunk +55 lines, -0 lines 0 comments Download
M pkg/pkg.status View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M tools/testing/dart/test_suite.dart View 1 3 5 chunks +38 lines, -2 lines 1 comment Download

Messages

Total messages: 12 (0 generated)
Alan Knight
8 years, 3 months ago (2012-09-19 22:34:33 UTC) #1
Alan Knight
Seems to be working now, at least on Mac. I've disabled running it on Windows, ...
8 years, 3 months ago (2012-09-20 21:05:12 UTC) #2
Emily Fortuna
lgtm with some suggestions https://codereview.chromium.org/10959002/diff/5002/pkg/intl/test/date_time_format_http_request_test.dart File pkg/intl/test/date_time_format_http_request_test.dart (right): https://codereview.chromium.org/10959002/diff/5002/pkg/intl/test/date_time_format_http_request_test.dart#newcode14 pkg/intl/test/date_time_format_http_request_test.dart:14: // ExtraCommandArgs=pkg/intl/test/start_web_server.dart will this be ...
8 years, 3 months ago (2012-09-20 23:07:19 UTC) #3
Emily Fortuna
+ whesse, resident test framework expert
8 years, 3 months ago (2012-09-20 23:13:45 UTC) #4
Alan Knight
https://codereview.chromium.org/10959002/diff/5002/pkg/intl/test/date_time_format_http_request_test.dart File pkg/intl/test/date_time_format_http_request_test.dart (right): https://codereview.chromium.org/10959002/diff/5002/pkg/intl/test/date_time_format_http_request_test.dart#newcode14 pkg/intl/test/date_time_format_http_request_test.dart:14: // ExtraCommandArgs=pkg/intl/test/start_web_server.dart On 2012/09/20 23:07:19, Emily Fortuna wrote: > ...
8 years, 3 months ago (2012-09-20 23:29:59 UTC) #5
ahe
https://codereview.chromium.org/10959002/diff/13002/tools/testing/dart/test_suite.dart File tools/testing/dart/test_suite.dart (right): https://codereview.chromium.org/10959002/diff/13002/tools/testing/dart/test_suite.dart#newcode688 tools/testing/dart/test_suite.dart:688: extraCommand = new Options().executable; This is wrong. I'll change ...
8 years, 3 months ago (2012-09-24 07:39:42 UTC) #6
William Hesse
LGTM, except that this is an ugly and fragile solution, that adds more special cases, ...
8 years, 3 months ago (2012-09-24 09:40:20 UTC) #7
Alan Knight
On 2012/09/24 09:40:20, William Hesse wrote: > LGTM, except that this is an ugly and ...
8 years, 3 months ago (2012-09-24 18:55:54 UTC) #8
Mads Ager (google)
Alan, I sympathize with the need to be able to get resources via an http ...
8 years, 2 months ago (2012-10-01 14:28:08 UTC) #9
Alan Knight
So, if I understand what you're suggesting, you'd have a flag on test suites to ...
8 years, 2 months ago (2012-10-01 22:46:13 UTC) #10
Mads Ager (google)
On 2012/10/01 22:46:13, Alan Knight wrote: > So, if I understand what you're suggesting, you'd ...
8 years, 2 months ago (2012-10-02 05:29:36 UTC) #11
gram
8 years, 2 months ago (2012-10-02 16:26:37 UTC) #12
For a moment yesterday I thought I had a great solution - incorporate a web
server in unittest and be able to start it up in setup/teardown. Then I realised
that wouldn't work of course because the tests in question are running in the
browser. However, I do want to throw out a related option, which is to have a
mock HttpClient. I'm not sure if that would meet your needs, Alan, but it does
have the advantage that the tests can be self-contained and should execute
faster.


On 2012/10/02 05:29:36, Mads Ager wrote:
> On 2012/10/01 22:46:13, Alan Knight wrote:
> > So, if I understand what you're suggesting, you'd have a flag on test suites
> to
> > indicate starting a web server, and hard-code it to be a web server, rather
> than
> > an arbitrary command. That seems reasonable. How would a flag on test suites
> be
> > indicated? 
> 
> I would add an extra named optional parameter to the TestSuite constructors in
> test_suite.dart. In test_runner.dart all test suites get added to the queue of
> test suites using the addTestSuite method. That would be a good place to check
> if the test suite needs a web server and start it at that point if it has not
> been started yet.
> 
> > How much functionality would you expect the web server to need? The
> > one I did, copied from one of our web site examples, is extremely minimal,
but
> > that might be adequate for many uses.
> 
> I think we should start as simple as possible and then do extensions as we
need
> them. Something that just makes sure that you cannot get to files outside of
the
> repo and otherwise just serves the files as simply as possible would be a
great
> start I think.
> 
> > There are other uses cases I had thought of for the ability to run commands
> like
> > testing or setting system attributes like environment variables (e.g. LANG)
or
> > checking the time zone. However, I think those could be done in simpler
ways,
> > like spawning a process from inside the Dart program under test.
> 
> I agree with this. I would rather have that done by spawning a process from
the
> test case itself.
> 
> > On 2012/10/01 14:28:08, Mads Ager wrote:
> > > Alan,
> > > 
> > > I sympathize with the need to be able to get resources via an http server
in
> > > connection with tests. However, I'm uncomfortable with the current
solution.
> I
> > > don't think we want to be able to run any command via comments in the test
> > code
> > > and the way this is done doesn't work on Windows at this point. I would
> > > therefore like to remove it as soon as possible so we do not get extra
> > > dependencies on it.
> > > 
> > > I would like to propose another way of doing this: How about writing a
> simple
> > > webserver in Dart that will serve up all of the dart repo. Then we can
have
> a
> > > flag on test suites telling us whether http access to the repo is needed.
We
> > can
> > > then build in the start and shutdown of the server in the test_runner. The
> > test
> > > runner can spawn the http server for the repo in the beginning if any of
the
> > > test suites run need http access and the server will be alive for the
> > life-time
> > > of the test script.
> > > 
> > > What do you think?
> > > 
> > > Cheers,    -- Mads
> > > 
> > >
> >
>
https://codereview.chromium.org/10959002/diff/5002/pkg/intl/test/start_web_se...
> > > File pkg/intl/test/start_web_server.dart (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/10959002/diff/5002/pkg/intl/test/start_web_se...
> > > pkg/intl/test/start_web_server.dart:23: new Timer(1000, (t) => exit(0));
> > > On 2012/09/20 23:29:59, Alan Knight wrote:
> > > > On 2012/09/20 23:07:19, Emily Fortuna wrote:
> > > > > Perhaps if we find ourselves doing more of these sorts of tests in the
> > > future,
> > > > > we may want to make some sort of polling solution.
> > > > 
> > > > Yes. This is pretty ugly. The delay isn't necessary in normal usage, but
I
> > > > though it would be helpful to leave in for debugging if something
breaks.
> > > 
> > > You actually have the hooks to wait for the process to start:
> > > p.onStart(callback). We should use that instead of a Timer. However, I
would
> > > prefer this code to not be necessary at all (see other comments).

Powered by Google App Engine
This is Rietveld 408576698